Page 1 of 1

YCbCr in TIFF

Posted: 2010-09-16T07:50:48-07:00
by Drarakel
Reading YCbCr:
There seems to be a minor issue with the photometric info in identify. When reading YCbCr in TIFF, the PHOTOMETRIC_YCBCR case (photometric value 6) is missing, and so it defaults to "unknown":

Code: Select all

convert logo: -colorspace ycbcr -compress jpeg test_ycbcr.tif
exiftool -S -PhotometricInterpretation test_ycbcr.tif
PhotometricInterpretation: YCbCr
identify -verbose test_ycbcr.tif
...
tiff:photometric: unknown


Writing YCbCr:
One should be able to store YCbCr in TIFF with LZW compression, right? That works e.g. with the rose image:

Code: Select all

convert rose: -colorspace ycbcr -compress lzw rose-ycbcr-lzw.tif
exiftool -S -PhotometricInterpretation -Compression rose-ycbcr-lzw.tif
PhotometricInterpretation: YCbCr
Compression: LZW

convert rose-ycbcr-lzw.tif rose.jpg
Image

But e.g. with the logo image (less than 256 colors), it fails. The photometric value is set to palette (and besides, even here, the YCbCrSubSampling tag is written):

Code: Select all

convert logo: -colorspace ycbcr -compress lzw logo-ycbcr-lzw.tif
exiftool -S -PhotometricInterpretation -Compression logo-ycbcr-lzw.tif
PhotometricInterpretation: RGB Palette
Compression: LZW

convert logo-ycbcr-lzw.tif logo.jpg
Image

I can only read such an image with a bad workaround:
convert logo-ycbcr-lzw.tif -set colorspace YCbCr -colorspace RGB logo2.jpg
Image

Re: YCbCr in TIFF

Posted: 2010-09-16T12:09:23-07:00
by magick
We can reproduce the problem you reported and have a patch in ImageMagick 6.6.4-3 Beta available by sometime tomorrow. Thanks.

Re: YCbCr in TIFF

Posted: 2010-09-16T13:11:13-07:00
by Drarakel
Awesome! Thank you for all those patches!

Re: YCbCr in TIFF

Posted: 2010-09-18T20:15:19-07:00
by Drarakel
Works in version 6.6.4-4. Thanks again.