imagemagickimagemagick-convertcolor-spacesrgbimagemagick-identify

ImageMagick identifies a different colorspace between Mac and Linux


I have a JPEG image.

On my Mac, when I type:

identify -verbose img.jpg

I get Colorspace: sRGB.

On my Linux box, when I type the same thing I get Colorspace: RGB.

Why? Has anyone encountered this before?


The reason this matters:

I get wildly different results when I use convert img.jpg -colorspace sRGB out.jpg between Mac and Linux. Obviously if they identify the source colorspace differently, then I could see why.


Solution

  • Ensure both systems are running the latest version. See release announcement about color management.

    Color management has changed significantly between ImageMagick version 6.7.5-5 and 6.8.0-3 in order to better conform to color and grayscale standards.

    In short

    ImageMagick supports color profiles, however, for images without a profile or a declaration of colorspace, ImageMagick assumes non-linear sRGB. Most image processing algorithms assume a linear colorspace, therefore it might be prudent to convert to linear color or remove the gamma function before certain image processing algorithms are applied.