Page 1 of 1

regression in -colorspace sRGB behavior

Posted: 2009-12-03T09:50:31-07:00
by Stanislav Brabec
It seems that new versions consider

Code: Select all

-colorspace sRGB
differently than

Code: Select all

-profile "sRGB Color Space Profile.icm"
I think it is not a correct behavior.

I was using following command in batch processing of images. Some of source images were in sRGB (and no profile was embedded in the image). Some of images were in AdobeRGB and profile was embedded.

Code: Select all

convert -colorspace sRGB $SRC $DEST
In ImageMagick-6.4.0.4 it was working correctly:
  • If the image had no profile, no color conversion was done, expecting input in sRGB.
  • If the input was in AdobeRGB, conversion to sRGB was performed.
In ImageMagick-6.4.3.6 (tested in 6.5.4.8) it changed its behavior and the result of the command is always much darker than expected.

It is wanted change or a regression compared to the previous behavior?

Note:

It seems that this works in a similar way than the command above:

Code: Select all

convert -profile /usr/share/color/icc/Adobe\ ICC\ Profiles/RGB\ Profiles/sRGB\ Color\ Space\ Profile.icm $SRC $DEST
But for sRGB images without embedded profile it complains:
convert: associate profile with image, a source and destination color profile required for transform `icc' @ profile.c/ProfileImage/812.
(Well, just in this case letting it without any conversion is exactly what I need.)

But this again does not work properly (too dark), with or without
embedded profile:

Code: Select all

convert -profile /usr/share/color/icc/Adobe\ ICC\ Profiles/RGB\ Profiles/sRGB\ Color\ Space\ Profile.icm -colorspace sRGB $SRC $DEST
It seems to be related to:

2008-06-03 6.4.1-6 Cristy <quetzlzacatenango at image...>
* The -colorspace option is an operator, not a setting.

Re: regression in -colorspace sRGB behavior

Posted: 2009-12-03T11:27:34-07:00
by magick
The colorspace option is a convenience. For proper colorspace transforms you need two profiles, a source and destination. Before you test, make sure LCMS support is included in your version of ImageMagick. For 'identify -list configure' we get lcms as one of the delegates as required. Next, assume your image is in the AdobeRGB1998 colorspace as indicated by an embedded AdobeRGB1998 profile. To verify, type
  • identify -verbose myimage
and ensure it mentions the AdobeRGB1998 profile. Not transform the colorspace with
  • convert myimage -profile "sRGB Color Space Profile.ICM" myimage-sRGB
If your AdobeRGB1998 image does not include an embedded colorspace use this command:
  • convert myimage -profile AdobeRGB1998.icc -profile "sRGB Color Space Profile.ICM" myimage-sRGB
If this command fails to produce proper results, post a URL to your sample image and the command you used and explain why the results are not correct. We need to reproduce the problem before we can offer additional help.