possible bug saving as 32-bit BMP3

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug saving as 32-bit BMP3

Post by fmw42 »

.

Reference: viewtopic.php?f=1&t=30063

This does not work for me on IM 6.9.5.1 OSX Snow Leopard

Code: Select all

convert logo: -blur 0x1 -transparent white -type truecoloralpha BMP3:test.bmp
Note: I added -blur 0x1 only to ensure that the result was not palettealpha, since without it, that is what I got.

Code: Select all

identify -verbose test.bmp
Image: test.bmp
  Format: BMP3 (Microsoft Windows bitmap image (V3))
  Class: DirectClass
  Geometry: 640x480+0+0
  Units: PixelsPerCentimeter
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Pixels: 307200
    Red:
      min: 4 (0.0156863)
      max: 255 (1)
      mean: 229.325 (0.899314)
      standard deviation: 66.3486 (0.260191)
      kurtosis: 4.26787
      skewness: -2.43631
      entropy: 0.234953
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 226.219 (0.887133)
      standard deviation: 67.5812 (0.265024)
      kurtosis: 3.00796
      skewness: -2.15575
      entropy: 0.272774
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 229.065 (0.898296)
      standard deviation: 60.5988 (0.237642)
      kurtosis: 3.75062
      skewness: -2.24566
      entropy: 0.275195
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 228.203 (0.894914)
      standard deviation: 64.9142 (0.254566)
      kurtosis: 3.71526
      skewness: -2.29045
      entropy: 0.260974
Note: No alpha channel. The result is 24-bit, not 32-bit.

I even tried

Code: Select all

convert logo: -blur 0x1 -transparent white -type truecoloralpha ppm:- | convert - BMP3:test.bmp
But still no alpha channel.


From Anthony's documentation:

"If you have an older program cannot read the default BMP4 images written by
ImageMagick, (for example a Windows Background Image), you can enforce the
generation of a BMP3 format image using...

convert image BMP3:image.bmp

This format should have no transparency and should be a 'printable image',
whatever that means."

Does this mean that IM does not support transparency in BMP3 or BMP3 does not support transparency?

From http://www.fileformat.info/format/bmp/egff.htm, it would appear that BMP3 (Windows 3x and Windows NT) do not allow transparency, only BMP4. So perhaps Anthony's docs are wrong or are talking about bits per channel depths.

Another reference indicates that some tools have written special version of BMP3 to add transparency. See discussion at viewtopic.php?t=16259
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: possible bug saving as 32-bit BMP3

Post by glennrp »

Did you try BMP4?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug saving as 32-bit BMP3

Post by fmw42 »

glennrp wrote:Did you try BMP4?
From his earlier post (viewtopic.php?f=1&t=30063#p135445), he says VS does not accept that format properly when just

Code: Select all

convert image.png image.bmp
I assume this is BMP4 by default. I do not believe that IM allows BMP4: prefix.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: possible bug saving as 32-bit BMP3

Post by dlemstra »

BMP4 is indeed the default and officially supports and alpha channel. We added an option to allow alpha in a BMP3 image a while back (viewtopic.php?f=1&t=28733&start=15).

Code: Select all

convert input.png -define bmp3:alpha=true bmp3:output.bmp
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug saving as 32-bit BMP3

Post by fmw42 »

dlemstra wrote:BMP4 is indeed the default and officially supports and alpha channel. We added an option to allow alpha in a BMP3 image a while back (viewtopic.php?f=1&t=28733&start=15).

Code: Select all

convert input.png -define bmp3:alpha=true bmp3:output.bmp
It is not listed at http://www.imagemagick.org/script/comma ... php#define. Could you please add it. Thanks

The only bmp -define is:

"bmp:format=value valid values are bmp2, bmp3, and bmp4. This option can be useful when the method of prepending "BMP2:" to the output filename is inconvenient or is not available, such as when using the mogrify utility."
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug saving as 32-bit BMP3

Post by fmw42 »

User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: possible bug saving as 32-bit BMP3

Post by dlemstra »

Would you mind helping us out Fred and make the changes to our website repository?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply