Page 1 of 1

Convert Images to Display P3 Colorspace

Posted: 2020-05-05T11:10:49-07:00
by aamir4774@gmail.com
Hi ImageMagick Community,

I need to convert jpg file to png with certain dpi and colorspace either sRGB or Display P3. Using the below command I'm able to convert the image to png sRGB colorspace. What will be the equivalent attribute to make the conversion in Display P3 colorspace?

Code: Select all

magick <input_file.jpg> -density 72 -resize 1920x1080 -colorspace sRGB -flatten -strip <output_file.png>
Thanks.

Re: Convert Images to Display P3 Colorspace

Posted: 2020-05-05T12:23:59-07:00
by snibgo
First, get an ICC profile file for each of sRGB and P3. Your IM installation directory probably contains sRGB.icc. http://color.support/iccprofiles.html has P3 profiles. I suggest you use the D65 one.

Assuming your input is encoded as sRGB, simply assign the sRGB profile and convert to the new profile:

Code: Select all

magick in.jpg -resize 1920x1080 -profile aRGB.icc -profile P3D65.icc out.jpg
Don't use "-strip". Your "-flatten" does nothing.

(Edited for typo.)