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
November 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.11.06 22:01 "Strange RGB values [Newbie Question]", by <50295@web.de>
2006.11.07 12:16 "Re: Strange RGB values [Newbie Question]", by Gerben Vos

2006.11.06 22:01 "Strange RGB values [Newbie Question]", by <50295@web.de>

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