2009.02.12 10:45 "[Tiff] Crosstesting request 12 bits per sample JPEG compression in TIFF", by

2009.02.12 10:45 "[Tiff] Crosstesting request 12 bits per sample JPEG compression in TIFF", by


I've replaced my JPEG subcodec in my proprietary TIFF codec. The old subcodec used to depend on LibJpeg, the new one depends on my new proprietary JPEG codec that supports 8 and 12 bits per sample both. Thus, I've extended my TIFF codec to support 12 bits per sample JPEG compression, also.

The subject of subsampling was particularly tricky. JPEG compression without subsampling is silly. Yet, the TIFF spec does not anticipate this need. In the end, I've decided to logically and unambigiously 'interpolate' the TIFF spec, as we've all done before on numerous occasions.

I've assembled a series of testfiles. They're only checked in the sense that encoder input matches decoder output. I've not been able to find a single software that can read back 12 bits per sample JPEG in TIFF, though, so there's been no crosstesting yet, and that's the reason for this post. I suspect some people in the GEO scene and possibly some others might have LibTiff extended with some special or dual LibJpeg build so as to support this. I'd be interested to see if these people can read back (some of) my testfiles. (Likely not all of them, as I go to some length supporting also combination of JPEG compression with planar storage, fillorder bit order reversal, CMYK and ITULAB color spaces, etc...) Also, the other way around, if anyone has some other 12 bits per sample JPEG in TIFF files to test with and/or can produce some, I'd be happy to test and see if my own decoder reads them back flawlessly.

The zipped testfile series is at http://www.awaresystems.be/imaging/tiff/12bpsjpegintiff.zip. It's a pretty large download, just over 13 megabyte.

All the testfiles in this series should yield the same rendering, being a nice lady with white skin, green eyes and red lips, before a blackened window and redish wall in the background. Except the files named 'Grayscale', that are a grayscale equivalent instead. All should be regarded legit, at least in my opinion, except that the '4x4' file in the 'Subsampling' folder leaves room for discussion (this particular subsampling is not correct in the JPEG file format, but it is in the TIFF file format, and in my mind the latter is the encapsulator whose spec has the final say in this matter), and the ones in the 'Incorrect subsampling values' folder that willingly have incorrect values for the TIFFTAG_YCBCRSUBSAMPLING tag so as to test auto-correction.

Let's hope we can ensure good interchange! If/when I find the time, I certainly hope to seriously extend my site thoroughly documenting all this stuff.

Best regards,