2005.03.30 19:41 "[Tiff] reading 16 bit grayscale", by Rick Schumeyer

2005.03.30 19:52 "Re: [Tiff] reading 16 bit grayscale", by Bob Friesenhahn

I've searched the FAQ and the archives, and I've seen some discussion about 16 bit grayscale images. But I haven't seen the answer to:

how can I use libtiff to read a 16 bit grayscale tiff? I don't want to display it, and I don't want it converted to 8-bit. I just want access to the 16-bit

My guess is that I should use something like TIFFReadScanLine. Is this correct? Is there a way to read the entire image in one call?

Yes, if the file is organized in scanlines or strips then you should use TIFFReadScanLine. Note that the 16-bit words are returned in native endian order for your CPU. You will need to invoke TIFFReadScanLine() for each scanline in the image.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/