Page 1 of 1

TIFF CMYK with JPEG compression

Posted: 2014-07-17T04:37:34-07:00
by gursch
Converting a TIFF CMYK image with JPEG compression to a JPEG corrupts colours. I tested with newest available version.

For example: convert tiff_jpeg_compressed.tif out.jpg

I prepared a sample file: https://dl.dropboxusercontent.com/u/197 ... ressed.tif

Re: TIFF CMYK with JPEG compression

Posted: 2014-07-19T14:01:08-07:00
by magick
How are the colors corrupted? You can expect some differences because JPEG is a lossy compression algorithm (set quality to 100 to minimize). Your input image includes a custom JPEG quantization table which ImageMagick does not honor. Finally there may be some difference when converting CMYK to sRGB. You may need to include a proper color profile to return proper color results.

Re: TIFF CMYK with JPEG compression

Posted: 2014-07-21T01:01:18-07:00
by gursch
I think "convert tiff_jpeg_compressed.tif out.jpg" does not change the colour space. It should change the format from tiff to jpeg. But in the resulting jpeg the black channel is missing completely.

Screenshot from the TIFF:
Image

Screenshot from the JPEG created with convert:
Image

Re: TIFF CMYK with JPEG compression

Posted: 2014-07-21T03:28:26-07:00
by magick
The black channel in this image is nothing but zeros, try identify -verbose tiff_jpeg_compressed.tif. It appears to be an sRGB image encoded in the CMYK format. We get reasonable results with:
  • convert tiff_jpeg_compressed.tif -set colorspace sRGB image.jpg

Re: TIFF CMYK with JPEG compression

Posted: 2014-07-29T09:01:45-07:00
by gursch
Thank you very much for the tip.

Re: TIFF CMYK with JPEG compression

Posted: 2014-08-25T02:38:49-07:00
by figge21
There is definitely an issue with conversion of CMYK TIFF images with JPEG compression in version 6.8.6-9.
After conversion the black channel is blank and the CMY channels are altered, producing a result looking almost like a negative image.

The same image conversion in version 6.7.9-9 produces a correct result.

CMYK TIFF images with other compressions are not affected.
Likewise RGB TIFFs with JPEG compression convert OK in 6.8.6-9.

*Edit*
It seems as though convert actually assumes that the input is RGB instead of CMYK.
C is mapped to R
M is mapped to G
Y is mapped to B
and the black channel is discarded altogether.

This is a screenshot of a simple test image:
Image

which looks like this after conversion in 6.8.6-9:
Image

The original test tiff is here https://dl.dropboxusercontent.com/u/841 ... iginal.tif

Re: TIFF CMYK with JPEG compression

Posted: 2014-10-26T14:34:13-07:00
by dlemstra
This bug will be fixed in the next release of ImageMagick (6.8.9-10).