YCbCr in TIFF

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
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

YCbCr in TIFF

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: YCbCr in TIFF

Post 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.
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: YCbCr in TIFF

Post by Drarakel »

Awesome! Thank you for all those patches!
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: YCbCr in TIFF

Post by Drarakel »

Works in version 6.6.4-4. Thanks again.
Post Reply