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

2017.05.11 18:55 "Re: [Tiff] JPEG compressed RGB tiled TIFF with chroma subsampling", by Even Rouault

On jeudi 11 mai 2017 19:45:23 CEST jcupitt@gmail.com wrote:

Hi, this took me a while to work out too.

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.

Yes, for encoding, use both TIFFTAG_JPEGCOLORMODE = JPEGCOLORMODE_RGB and TIFFTAG_PHOTOMETRIC = PHOTOMETRIC_YCBCR. By default this will use h_samp_factor = v_samp_factor = 2.

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

--
Spatialys - Geospatial professional services
http://www.spatialys.com