2004.12.07 12:25 "[Tiff] Fetching pixel data from 4bit tiff", by Dan Field

2004.12.07 17:04 "Re: [Tiff] Fetching pixel data from 4bit tiff", by Bob Friesenhahn

You should use TIFFReadScanline() to read each scanline into memory you have allocated. There is one scanline per row. The scan-line is returned packed according to the TIFF specification, with two samples per byte. It is a small matter of masking and shifting to obtain each nibble. The only tricky case is to properly handle an image with an odd number of columns.

This appears to work with rows though. I need to sample from columns aswell as rows. Is there any way to take a vertical scanline with this function?

Your TIFF image is organized as rows. In order to obtain a column, you will need to request all of the rows, and select the samples from each row which correspond to the column. Most image processing package extract the TIFF image into their own representation (often a simple array) which is much easier to access.


Bob Friesenhahn