AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2004.12.29 09:39 "[Tiff] TR:", by Jamel BEL HADJ BRAHIM
2004.12.29 10:37 "Re: [Tiff] TR:", by Joris Van Damme
2004.12.29 11:32 "[Tiff] (no subject)", by Jamel BEL HADJ BRAHIM
2004.12.30 08:42 "[Tiff] Search samples of using COMPRESSION_CCITTFAX4, LSB2MSB", by Jamel BEL HADJ BRAHIM
2004.12.30 11:41 "Re: [Tiff] Search samples of using COMPRESSION_CCITTFAX4, LSB2MSB", by Joris Van Damme

2004.12.29 10:37 "Re: [Tiff] TR:", by Joris Van Damme

Jamel,

How can I use FillOrder=Lsb2ToMsb, TIFFTAG_COMPRESSION = COMPRESSION_CCITTFAX4?

TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX4);

TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);

TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 2);

TIFFWriteEncodedStrip(out, 0, buffer, XSIZE * YSIZE);

Check the return value of TIFFWriteEncodedStrip, it probably indicates an error since you can't use FAX4 compression with 2bit per pixel data. Either

  1. you mean to write black and white, 1 bit per pixel data. In that case, correct the TIFFTAG_BITSPERSAMPLE value.
  2. or you mean to write 2 bit per pixel data. In that case, write a colormap, uses PHOTOMETRIC PALETTE, and use compression LZW or ADOBE_DEFLATE.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html