Page 1 of 1

using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-01T11:35:19-07:00
by pikachu
Hi there,

If you use convert.exe (version 6.5.0) to convert a black&white BMP to a TIF the TIF-tag 262 (PhotometricInterpretation) is set to 1 (Black is Zero).
Definition: For bilevel and grayscale images: 0 is imaged as black. The maximum
value is imaged as white. If this value is specified for Compression=2, the
image should display and print reversed.

So far this works OK and there is no problem.
(e.g. convert c:\picture.bmp c:\uncompressed.tif) where picture.bmp is a black&white BMP-File

If you add Group4 Compression to the resulting TIF the file is compressed but it will be shown (and printed) in reverse.
(e.g. convert -compress Group4 c:\picture.bmp c:\compressedGroup4.tif)
Please note that some viewers (as IrfanView or Microsoft Document Imaging) display the TIF correctly. Other viewers (like Microsoft Windows Picture and Fax Viewer) display the picture in black.

So in my opinion this is a bug as the use of Group4-compression does not consider "Black is zero". In earlier versions (like 6.2.5) the PhotometicInterpretation has been set to 0 (White is zero). This might be a reason why this bug never showed up.

If you use LZW compression on the other hand the image is still set to "Black is zero" but will be shown correctly. (e.g. convert -compress lzw c:\picture.bmp c:\compressedLZW.tif)

greets
Pikachu

Re: using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-01T11:45:41-07:00
by magick
We will have a patch for this problem in ImageMagick 6.5.1-1 by sometime tomorrow. Thanks.

Re: using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-06T15:20:54-07:00
by pikachu
Hi there....

I would like to ask if there is any progress on this issue?`

kind regards
pikachu

Re: using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-06T18:09:03-07:00
by magick
The patch is in ImageMagick 6.5.1-1 Beta.

Re: using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-07T07:43:56-07:00
by pikachu
Hi there....

Thanks, the fix works quite well (photometric interpretation is now set to MinIsWhite).
Do you know when the next version will be shipped (this means leave the beta-state)?

kind regards

Re: using convert.exe on B/W-Image swaps backgroundcolor

Posted: 2009-04-07T07:46:26-07:00
by magick
It is likely, ImageMagick 6.5.1-1 Beta will release by the end of the week,