To get upsampled YCbCr JPEG, just use

TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );

before using TIFFReadEncodedTile / TIFFReadEncodedStrip

Le 10/06/2022 à 21:29, L. E. Segovia via Tiff a écrit :
Hi again,

A quick update: it's been already reported to this list... in 2003.

https://www.asmail.be/msg0054686955.html

We have our own upsampler for lossless compressors but the JPEG (uncompressed) strip looks like it's laid out differently. If anyone knows how to upsample it, I'll be glad to fix it in Krita.

amyspark

On 21/05/2022 16:37, L. E. Segovia via Tiff wrote:
Hi all,

Recently one of my colleagues at Krita found an abandoned TIFF in our source code repository that, to the best of our knowledge, had never been checked into our test suite.

Turns out, it is a JPEG-compressed, YCbCr TIFF. I've recently added color space profiles for YCbCr, but when loading this sample inside our app, the output shows significant corruption as well as misaligned strips.

I've tried the tiff2rgba and rgba2ycbcr tools to generate copies, and can confirm that:

- Loading YCbCr TIFFs with anything but JPEG compression works.
- Loading RGBA TIFFs with any compression, including JPEG, works.

which leads me to conclude that the expected layout of YCbCr + JPEG doesn't match what it says on the tin ("Ordering of Component Samples", page 93 of the standard). Unfortunately, I can't verify my suspicions with libtiff's source code itself, as in all cases, either the data is already in RGB form or libjpeg-turbo is asked to convert it to RGB.

Does anyone know what the layout of this kind of data is? Or, alternatively, where I could start looking?

Best,

amyspark


--
http://www.spatialys.com
My software is free, but my time generally not.

_______________________________________________
Tiff mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/tiff

Reply via email to