2022.05.21 19:37 "[Tiff] How to read JPEG-compressed YCbCr TIFFs", by L. E. Segovia
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?
amyspark 🌸 https://www.amyspark.me