Code: Select all
convert in.png -profile AdobeRGB1998.icc -strip -profile AdobeRGB1998.icc out.png
The idea is to first convert to the AdobeRGB1998.icc profile and then strip comments from the file. However, since "-strip" also strips color profiles, there is an additional "-profile AdobeRGB1998.icc" option after the "-strip" to re-add the profile.
ImageMagick Version: ImageMagick 7.0.9-2 Q16 x86_64 2019-10-31
OS: macOS 10.13.6
Expected output: out.png should contain an AdobeRGB1998.icc profile
Actual output: out.png does not contain an ICC profile
The result is that the colors in the image are relative to the AdobeRGB1998 profile, but the profile is not embedded in the image, which leads to incorrect colors when the image is displayed. This seems like a bug.
This problem does not occur if I write to a jpg:
Code: Select all
convert in.png -profile AdobeRGB1998.icc -strip -profile AdobeRGB1998.icc out.jpg
Code: Select all
convert in.png -profile AdobeRGB1998.icc -strip tmp.png
convert tmp.png -profile AdobeRGB1998.icc out.png