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
January 2006

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

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



Valid HTML 4.01!



Thread

2006.01.11 02:01 "help on reading a 16bits grayscle TIFF image", by Nguyen Quang Bang
2006.01.11 02:40 "Re: help on reading a 16bits grayscle TIFF image", by Bob Friesenhahn

2006.01.11 02:40 "Re: help on reading a 16bits grayscle TIFF image", by Bob Friesenhahn

On Wed, 11 Jan 2006, NGUYEN QUANG BANG wrote:
>  
> I have a problem while reading a 16 bits grayscale TIFF image.
> when i use the function TIFFReadRGBAImage and TiffReadEncodedStrip, they
> give different results.
> When i read this image using MatLab, it gives the image with the pixels have
> value RGB as result of TIFFReadRGBAImage,and the corresponding index as the
> result of TiffReadEncodedStrip function.

TIFFReadRGBAImage() is a higher level function than 
TiffReadEncodedStrip().  The TiffReadEncodedStrip() function returns 
the raw-uncompressed data from the TIFF.  This data could be indexes 
into a colormap containing 16-bit RGB color samples.  Or it could be 
raw gray samples.  But TIFFReadRGBAImage() always represents the image 
as TrueColor RGB so it must used the indexes and the colormap (or the 
raw gray samples) to create the equivalent (or as close as possible) 
TrueColor RGB image.  For your gray image, TIFFReadRGBAImage() needs 
to emulate the gray by using equal parts of red, green, and blue.

TIFFReadRGBAImage() is intended for casual libtiff users that don't 
have the time to deal with the many permutations of the TIFF format.

So what is your question?

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