AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2002

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date


The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems

Valid HTML 4.01!

2002.05.29 20:28 "question about getting "normalized" RGB data", by Bradley Flubacher

I'm using libgeotiff along with libtiff to extract a sub-section of a
large GeoTIFF file. I've finally got it all working right.  The end
result is a texture-mapped terrain face. It looks pretty neat!

This is finally working, but I had to alter the libtiff code to make it
do what I think it should be doing-

I have two test images. One is gray-scale (16 bit) and the other is RGB,
16-bits per component.  However, the whole dynamic range is NOT being
used! In other words, the maximum value is NOT 0xffff, but rather more
like 0x1fff.

So, in order for the "put" function to work correctly (called through
TIFFReadRGBAStrip), I had to find the maximum sample value (through the
tag), and normalize each component by this value, then multiply the
result by 0xffff. After doing this, dropping the least-significant bits
leaves a good looking image.  If I don't do this, the resultant image is
basically BLACK because the MSB's don't carry much information at all!

Does this sound right to you?

Thanks in advance!