Converting HEIC images with Display P3 color profile

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
psimeon
Posts: 3
Joined: 2018-06-29T12:10:43-07:00
Authentication code: 1152

Converting HEIC images with Display P3 color profile

Post by psimeon » 2018-06-29T12:22:49-07:00

I am trying to convert HEIC images shot with the lastest generation of iPhones. They are in HEIC format and use the "Display P3" color profile. When I try to convert the images to JPGs the colors get washed out. The profile in the picture is an exif-profile, not an ICC profile. I assume 'convert' does not recognise this kind of profile. Is there a way to tell 'convert' to use an external icc-profile (I have a "Display P3" icc file extracted from a JPEG) and use that to interpret the image data while converting to JPGs?

I'm using the latest version of ImageMagick compiled from source on a CentOS server.

Thanks for any help.

User avatar
fmw42
Posts: 24125
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting HEIC images with Display P3 color profile

Post by fmw42 » 2018-06-29T12:42:19-07:00

If the input has a profile (icc, icm), then add one -profile for the output color type.

Code: Select all

convert input -profile path/to/profile.icc output
If the input has no profile (icc, icm), then add two profiles, one for what the input color type is and one for what you want for the output

Code: Select all

convert input -profile path/to/profile1.icc -profile path/to/profile2.icc output
see http://www.imagemagick.org/script/comma ... hp#profile

snibgo
Posts: 10954
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting HEIC images with Display P3 color profile

Post by snibgo » 2018-06-29T13:16:25-07:00

As Fred says. ICC profiles for P3 are available from http://color.support/iccprofiles.html
snibgo's IM pages: im.snibgo.com

psimeon
Posts: 3
Joined: 2018-06-29T12:10:43-07:00
Authentication code: 1152

Re: Converting HEIC images with Display P3 color profile

Post by psimeon » 2018-06-29T14:54:59-07:00

fmw42 wrote:
2018-06-29T12:42:19-07:00
If the input has no profile (icc, icm), then add two profiles, one for what the input color type is and one for what you want for the output

Code: Select all

convert input -profile path/to/profile1.icc -profile path/to/profile2.icc output
I tried to do that

Code: Select all

convert IMG_8938.HEIC -profile Display\ P3.icc -profile sRGB2014.icc IMG_8938_srgb.jpg
but it gives me totally wrong colors.

I have put the images on our server, maybe it helps if you can see the images:
http://test.olloworld.com/assets/image/ ... _8938.HEIC (original Image)
http://test.olloworld.com/assets/image/ ... G_8938.JPG (JPG sRGB created with Preview on the Mac)
http://test.olloworld.com/assets/image/ ... 938_IM.jpg (JPG from ImageMagick without profiles)
http://test.olloworld.com/assets/image/ ... 8_srgb.jpg (JPG from Image Magick with profiles)

Do I have to specify a different input color space?

Any other ideas?

User avatar
fmw42
Posts: 24125
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting HEIC images with Display P3 color profile

Post by fmw42 » 2018-06-29T15:09:41-07:00

Put double quotes around your path to the icc file. Imagemagick thinks you have two words due the space.

convert IMG_8938.HEIC -profile "Display\ P3.icc" -profile sRGB2014.icc IMG_8938_srgb.jpg

psimeon
Posts: 3
Joined: 2018-06-29T12:10:43-07:00
Authentication code: 1152

Re: Converting HEIC images with Display P3 color profile

Post by psimeon » 2018-06-30T14:16:24-07:00

fmw42 wrote:
2018-06-29T15:09:41-07:00
Put double quotes around your path to the icc file. Imagemagick thinks you have two words due the space.

convert IMG_8938.HEIC -profile "Display\ P3.icc" -profile sRGB2014.icc IMG_8938_srgb.jpg
The space was escaped with the backslash.'I tried with quotes, same effect. Convert found the file, but applied in a way that gave the wrong colors.

User avatar
fmw42
Posts: 24125
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting HEIC images with Display P3 color profile

Post by fmw42 » 2018-06-30T14:40:46-07:00

Sorry, I do not have installed the HEIC delegate, so I cannot check for you. You will need one of the developers to check this for you.

Post Reply