2004.05.18 15:05 "[Tiff] Further doubt on bits per sample", by Mayank

2004.05.18 13:13 "Re: [Tiff] Further doubt on bits per sample", by Frank Warmerdam

1. How does the bits per sample cases of 1,4 or 5 are handled by the libtiff library? Does the readstrip/readtile functions return the data, such that, the pixel values are always packed in byte boundaries?


Pixels are packed into the bytes, and in the case of odd numbers of bits per sample would potentially span bytes.

i.e. for bits per sample case of 4, are two pixel values clubbed into one byte or one byte always contains one pixel value only?

Or lets say for bits per sample case of 5 or 9, a pixel value is contained in a byte or a word respectively.

In the case of 1, 2 or 4 bits per sample there would be 8, 4 or 2 pixels stored in each byte

2. Does the same scheme (as for readstrip/readtile) applies for writestrip/writetile functions?


Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent