2017.04.03 17:05 "[Tiff] Reading images with bits per pixel not a multiple of 8", by Dinesh Iyer

2017.04.03 17:50 "Re: [Tiff] Reading images with bits per pixel not a multiple of 8", by Bob Friesenhahn

My understanding is that after calling TIFFReadEncodedStrip/Tile the data I get back is packed i.e. one sample might have all its bits stored across a byte-boundary. Is this true for all cases or does this apply only for PackBits compression?

It applies for all cases.

Except for depths 8, 16, and 24 (which are swapped to "native" endianness by libtiff), the data is always ordered in most-significant-bit order

so you need to start with the top bits.

I put sample files (with interesting strange depths) written by GraphicsMagick out for ftp under ftp://ftp.simplesystems.org/pub/tiff-samples/

In particular

ftp://ftp.simplesystems.org/pub/tiff-samples/tiff-sample-images-be.tar.gz

and

ftp://ftp.simplesystems.org/pub/tiff-samples/tiff-sample-images-le.tar.gz

There are also BigTIFF versions there.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/