2022.05.21 19:37 "[Tiff] How to read JPEG-compressed YCbCr TIFFs", by L. E. Segovia

2022.06.16 16:37 "Re: [Tiff] How to read JPEG-compressed YCbCr TIFFs", by L. E. Segovia

Hey,

It was indeed doable, by hand. I've achieved roundtrip loading of YCbCr + JPEG TIFFs with the help of libjpeg-turbo.

The first step is to enable the library to prime the decoder with the tables stored in TIFFTAG_JPEGTABLES:

https://github.com/libjpeg-turbo/libjpeg-turbo/pull/605

The second step was to parse each raw strip into separate planes, massage them to match the lossless YCbCr sample format, and then treat the strip as a standard subsampled YCbCr. I've pushed the latter as part of this MR to Krita:

https://invent.kde.org/graphics/krita/-/merge_requests/1478

(check out the commit entitled "tiff: support YCbCr + JPEG imports")

amyspark

amyspark 🌸 https://www.amyspark.me