Tiff CMYK to JPG RGB errors

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
aaronharder

Tiff CMYK to JPG RGB errors

Post by aaronharder »

Hello! First, thanks for ImageMagick, a really great package of graphics tools.

I've encountered a possible bug. I have tried to convert the following TIFF image from Photoshop CS3 from CMYK to an RGB jpeg:

http://pronto.entropy.cc/bad_colors_in_magick.tif

I have used a variety of methods with convert, primarily extracting the profile to an .icc file and using -profile:

convert bad_colors_in_magick.tif -profile cmyk.icc -colorspace RGB -profile sRGB.icc output.jpg

But the output is always mis-colored:

http://pronto.entropy.cc/output.jpg

I am not 100% sure the process I am using here is the official correct way to do such a conversion. However, this exact method has worked fine for us with ImageMagick on hundreds of CMYK images in the past, but the same approaches are suddenly choking on these new images we're getting from CS3 on Macintosh. And these same CS3 TIFF images look fine when opened in several different versions of Photoshop we've tried. I've confirmed this behavior happens on several versions of ImageMagick, ranging from 6.2.2 on Linux (which is how I generated the "output.jpg" above) to 6.5.6 on Mac, and a couple in between. They all produce the same mis-colored output.

Here is the cmyk.icc, extracted using "convert bad_colors_in_magick.tif cmyk.icc"

http://pronto.entropy.cc/cmyk.icc

And here is the sRGB.icc I'm using (which I have used successfully for years with ImageMagick on other TIFF cmyk images):

http://pronto.entropy.cc/sRGB.icc


Any help diagnosing and/or fixing this problem would of course be much appreciated.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Tiff CMYK to JPG RGB errors

Post by magick »

Your image uses JPEG YCbCr subsampling. For that type of image, we ask the TIFF delegate library to decode the image and return it as RGB pixels. There is either something wrong with the image pixels or a bug in the TIFF delegate library. We tried tifftopnm, Eye of Gnome, and Gimp and they all returned the same results as ImageMagick.
aaronharder

Re: Tiff CMYK to JPG RGB errors

Post by aaronharder »

Yes, as you note, this certainly does seem to be a widespread issue, not just confined to ImageMagick. Even Picasa on Mac and Irfanview on the PC seem to interpret these images this way. However, as I noted all versions of Photoshop I've tried are happy with this CS3-generated TIF, and show the colors as intended. I will probably ask our client to upgrade to CS4, because that seems to generate JPEG-compressed TIFs just fine in my tests, and ImageMagick can read colors from those CS4 TIFs as intended.

Thanks very much for your reply, and taking time to look at it!
Post Reply