2006.11.06 22:01 "[Tiff] Strange RGB values [Newbie Question]", by Olumide

2006.11.06 22:01 "[Tiff] Strange RGB values [Newbie Question]", by Olumide

Hello

I have a white, uncompressed TIFF image (no color), which I'm trying to read. For some reason, I'm getting mostly 205 color values for each channel.

Code snippet:

uint32 *buffer;
int imgWidth, imgHeight, imgSize;

TIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &imgWidth);

TIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &imgHeight); imgSize = imgWidth * imgHeight + 1;

buffer = (uint32 *) malloc( sizeof(uint32 *) * imgSize; TIFFReadRGBAStrip(tiff, 0, buffer);

for( i = 0; i < imgWidth; i++)
{
        for( j = 0; j < imgHeight; j++)
        {
                printf("%d ", TIFFGetR( buffer[j*imgWidth + i]) );
        }
        printf("\n");
}

Output:

... 255 255 *205 205 205 205 205 205 205 205 ... *
... 255 255 *205 205 205 205 205 205 205 205 ... *

Where does the 205 come from? Thanks,

- Olumide