AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2010.05.10 16:28 "[Tiff] two channel data stored as real", by Morgenstern, James
2010.05.10 17:00 "Re: [Tiff] two channel data stored as real", by Frank Warmerdam
2010.05.11 07:29 "Re: [Tiff] two channel data stored as real", by

2010.05.11 07:29 "Re: [Tiff] two channel data stored as real", by

James,

I have two channel image data that I want to store as real. I have done the straightforward thing and set samples per pixel=2, SAMPLEFORMAT_IEEEFP, PLANARCONFIG_CONTIG. The tiff readers I am using complain about it being a bad file. So is the problem the tiff readers? Or do I not understand all there is to making two channel tiff files?

I don't think I agree with previous comments about 'picture oriented tiff viewers'. It's not the viewers that are picture oriented, the actual fact is that tiff itself is an image file format. That said, it is extremely suitable for storing a lot of additional info, in addition to the image that is.

So the first thing you need to consider, is what part of your data makes most sense as an image, to anyone who doesn't have additional knowledge about how to interpret your additional data. Depending on your exact data, it may be that the first channel might make most sense when interpreted as grayscale whilst the second channel is totally unsuitable for visual representation, or it might be that your data is best visualized as two channels out of a three-channel colorspace, or grayscale with alpha, or whatever. When you've dediced, you'll know how you want to store.

That way you'll have a legit tiff, and proper tiff usage. It doesn't yet imply that your files will be viewable by most main-stream viewers. For example, if you decide the first channel is best visualized as grayscale and the second channel is merely extra data without visual meaning, you'll find most viewers based on libtiff will incorrectly interpret the second channel as badly tagged alpha even if you properly tag it as unspecified. In addition to all that, you may find that most viewers are unable to deal with the floating point sampleformat. Not much you can do about that, this part is not your mistake to fix.

Best regards,

Joris