2017.05.11 17:35 "[Tiff] JPEG compressed RGB tiled TIFF with chroma subsampling", by Yakov Galka

2017.05.11 19:37 "Re: [Tiff] JPEG compressed RGB tiled TIFF with chroma subsampling", by Yakov Galka

On Thu, May 11, 2017 at 9:45 PM, <jcupitt@gmail.com> wrote:

Just set TIFFTAG_JPEGCOLORMODE to JPEGCOLORMODE_RGB. This is a pseudo-tag -- it means you are going to supply RGB data, but that the encoder is free to convert to YCBCR and subsample in the usual way.

Hmm, thanks.

You need to set it on decompress too I think to make libjpg convert the YCBCR back to RGB for you.

The important requirement here is that 'typical' TIFF readers would be able to read the file. This seems to work, however, in the few viewers I've checked.

It is a misdesign however -- because it's not transparent to the reader. If the author of the reader did not handle this JPEG corner-case specifically, then it's going to fail.

--
Yakov Galka
http://stannum.co.il/