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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
pikachu

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

We will have a patch for this problem in ImageMagick 6.5.1-1 by sometime tomorrow. Thanks.
pikachu

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

Post by pikachu »

Hi there....

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

kind regards
pikachu
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

The patch is in ImageMagick 6.5.1-1 Beta.
pikachu

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

It is likely, ImageMagick 6.5.1-1 Beta will release by the end of the week,
Post Reply