2002.01.16 10:57 "How to read Tiff-grayscale", by Shan

2002.01.16 23:46 "Re: How to read Tiff-grayscale", by Peter Skarpetis

How can i read TIFF-GRAYSCALE and TIFF-RGB image using Tiff library. I have done some work and working fine for TIFF-CMYK not for GARYSCALE and RGB.

You would use the exact same code you use for your CMYK code except that TIFFReadScanline would require a different size input buffer for RGB and grayscale.

You can use TIFFScanlineSize() to get the number of bytes you need to allocate for one scanline.

Then the samples will be ordered as RGB.... RGB for RGB images and as KKKKK.... for grayscale images.

If there is an alpha channel you will need to include code to check and either skip over it in the scanline buffer or use it in your code as an alpha channel

Peter Skarpetis
Serendipity Software Pty Ltd
67 Fitzroy Street
Surry Hills NSW 2010
Sydney Australia

Phone: +612 93321788
Fax: +612 93321766
email: peters@serendipity-software.com.au
WWW: http://www.riponce.com