2011.12.22 00:50 "[Tiff] Announcing Libtiff 4.0.0", by Bob Friesenhahn

2012.01.04 14:55 "Re: [Tiff] reading rgb values from 16 bits tif images", by Martin Alegre

Hi Olivier,

Thanks for your reply. I checked the libtiff tutorial ( http://www.libtiff.org/libtiff.html) and found something about using *TIFFReadScanline* in the *Scanline-based Image I/O* section. However, it's still not clear to me, how to adapt the code given in the tutorial to read 16 bit RGB images.

More precisely, how to post-process the buffer (*buff*) after calling the function* TIFFReadScanline(tif, buf, row)*?

Do you mind in illustratiing how to use the *TIFFReadScanline *for such sort of images?

Best,

Tin

On Wed, Jan 4, 2012 at 3:07 PM, Olivier Paquet <olivier.paquet@gmail.com>wrote:

On Wed, Jan 4, 2012 at 5:54 AM, Martin Alegre <tin.alegre@gmail.com> wrote:

I'm trying to read the RGB values of 16 bits tif images. To do that, I'm using the TIFFReadRGBAImage function to first load the data into memory and store it into a buffer. Then, by calling the TIFFGet{R,G,B} functions, I

I'm fairly certain the TIFFReadRGBAImage function will always load 8-bit data, converting whatever is in the image to that format. To get to the 16-bit values, try TIFFReadScanline. You'll then need to check various tags to interpret the data correctly: number of samples per pixel, bits per sample, etc.