2003.11.03 05:43 "Using libtiff for 16-bit tiff", by

2003.11.03 19:14 "[Tiff] Re: Using libtiff for 16-bit tiff", by Andrey Kiselev

I am trying to use libtiff to open 16-bit tiff images but it appears black. Is it possible? I am currently using the function TIFFReadRGBAImage(tif, w, h, raster, 0) but it returns -1. Do I have to call another function?

Yes, you need other approach. TIFFReadRGBAImage() was introduced to work well with 8-bit images only. It can handle 16-bit ones, but in very dumb way: by rejecting the least significant part of the word. It is equal to division by 256. It works well for wide dynamic ranges only.

You should use low-level functions such as TIFFReadScanline(), TIFFReadEncodedStrip() and TIFFReadTile().

And my last question, do you have an example in Visual c++?

Look at the tools directory, there are many examples there.

Best regards,
Andrey

PS. tiff@olimpiacos.org is not functional any more. Please, address your questions to the tiff@remotesensing.org. You can subscribe to the list here:

http://remotesensing.org/mailman/listinfo/tiff/

Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517