2005.04.11 00:03 "[Tiff] TIFF Technote 3, draft 1", by Chris Cox

2005.04.12 02:29 "Re: [Tiff] TIFF Technote 3, draft 1", by Chris Cox

Thanks for your clarification.

Without the predictor, you do have to byte swap the image data for floating point data that has BitsPerSample equal to a multiple of 8. Yeah, that should be obvious.

I appologise for my stupidity. I am totally unaware of the Motorola platform, for all I knew IEEE floats could have been orderer exactly the same there as on the Intel platform, as opposed to integer 16bit values, and contemplating that possibility confused the issue for me.

It's not just Motorola (it's almost everyone other than Intel ;-). Any data value with more than 8 bits and that has a length that is a multiple of 8 bits has to be byte order swapped. That applies to integer, float, and even to "unknown" values.

With this predictor, you don't need to do that extra step, because the predictor does byte reordering as part of the prediction process. (which complicates the TIFF pipeline a little, but does help compression quite a bit).

I've had an extra look at the sample code, and together with your clarification, I *think* I understand now, but I'm still not entirely sure. Am I seeing correctly now that, with the predictor in use, the image data is equal in both byteorder flavor TIFFs?

After going through the predictor, in the file - yes.

Are there any test images available in both byte orders, preferably both combined with and without predictor scheme, that would allow me to test my understanding?

I have some, but it's about 160 Meg total. (30 Meg for 16 bit, 42 Meg for 24 bit, and 57 Meg for 32 bit)

Abusing the fact that I have your attention, I'd like to ask something that is only remotely related, in that it also shares my confusion surrounding byte order in image data... Say you have 3 channels, 12, 13, and 16 bits wide, in ordinary TIFF, with ordinary integer SampleFormat. That means the 16bits channel does not even start on a byte boundary for most columns. Is it nevertheless subject to byteswapping?

You can't interleave mixed bit depths.

And anything that isn't a multiple of 8 bits goes in natural bit order - aka BigEndian.

Chris