2008.07.03 21:18 "[Tiff] Converting BMP to Tiff", by Lou Feliz

2008.07.21 11:48 "Re: [Tiff] Converting BMP to Tiff", by Gerben Vos

I updated the function to use COMPRESSION_LZW and it works as I need it.

The actual problem is this line in the WriteBitmapToTiff function:

TIFFSetField(OpenTiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);

You should change that to:

TIFFSetField(OpenTiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);

This is because in bitmaps usually 0 means black and 1 means white. But in TIFF it is quite common to use the opposite representation, because that is also used by faxes.

I'm not quite sure why changing the compression to LZW also works for you. Maybe the TIFF viewer that you use ignores the difference between these two photometrics when you view an LZW-compressed image.

Gerben.