Page 1 of 1

possible bug saving as 32-bit BMP3

Posted: 2016-07-13T14:46:06-07:00
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

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-15T11:55:08-07:00
by glennrp
Did you try BMP4?

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-15T12:57:35-07:00
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.

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-15T13:31:31-07:00
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

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-15T13:36:08-07:00
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."

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-21T14:03:13-07:00
by fmw42

Re: possible bug saving as 32-bit BMP3

Posted: 2016-07-21T22:07:36-07:00
by dlemstra
Would you mind helping us out Fred and make the changes to our website repository?