2014.12.15 17:49 "[Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault

2014.12.21 15:38 "Re: [Tiff] Unnecessary bigger JPEG-compressed TIFF", by Even Rouault

Le dimanche 21 décembre 2014 16:08:07, Bob Friesenhahn a écrit:

On Sat, 20 Dec 2014, Tom Lane wrote:

And from my testing with old imagemagick it seems that gm convert doesn't produce a YCbCr JPEG-compressed TIFF.


Does YCbCr make that big of a difference?

Possibly. What were you doing instead? RGB output would be substantially larger than YCbCr, possibly approaching 3x larger. (That still isn't enough to explain the reported size difference though.)

GraphicsMagick is setting the photometric to PHOTOMETRIC_RGB and setting the TIFF TIFFTAG_JPEGCOLORMODE tag to JPEGCOLORMODE_RGB. I was hoping to avoid having to deal with YCbCr directly and that the RGB would be magically transformed to YCbCr (by libjpeg) but it seems that is not what is happening. RGB is being stored instead.

You just need setting PHOTOMETRIC_YCBCR for that to happen automagically.

GraphicsMagick should of course be able to directly input/output YCbCr data in TIFF, but supporting the various sampling modes seem like a chore. To be honest, I have not researched it at all.

At least, if using the TIFFRead/WriteEncodedStrip/Tile interface, there's nothing particular to do. Upsampling/downsampling is handled by the JPEG codec.

> Bob

Spatialys - Geospatial professional services