bmp to png conversion

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

bmp to png conversion

Post by indiego »

Hi,

I have here some bmp graphics with transparency which I want to convert into png. I tried it with "-channel rgba", "-alpha set" and "-matte", but sadly I don't get the right transparency values. Conversion via Gimp works.
Tested with IM 6.6.5-0 and IM 6.6.7-4 on windows.

Link to test graphic "27.bmp":

http://storeplace.org/img/show.php/3305_27.bmp.html

bmp is such a shitty format...


-
indiego
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to png conversion

Post by fmw42 »

when I download and look at the verbose information, it does not show any transparency. Perhaps your upload host cannot store it with transparency. check your image

identify -verbose 27.bmp

does that show any transparency?
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: bmp to png conversion

Post by indiego »

Mh, strange. I just downloaded the graphic via right mouse button menu (save as...). Checked the bmp with gimp and it looked ok. "identify -verbose 27.bmp" gives
  • Image: 27.bmp
    Format: BMP (Microsoft Windows bitmap image)
    Class: DirectClass
    Geometry: 348x36+0+0
    Units: PixelsPerCentimeter
    Type: TrueColor
    Endianess: Undefined
    Colorspace: RGB
    Depth: 8-bit
    Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    Channel statistics:
    Red:
    min: 0 (0)
    max: 255 (1)
    mean: 101.879 (0.399527)
    standard deviation: 86.066 (0.337514)
    kurtosis: -1.09022
    skewness: 0.376069
    Green:
    min: 0 (0)
    max: 255 (1)
    mean: 107.189 (0.420348)
    standard deviation: 86.5704 (0.339492)
    kurtosis: -1.1724
    skewness: 0.241687
    Blue:
    min: 0 (0)
    max: 255 (1)
    mean: 110.716 (0.434182)
    standard deviation: 87.2461 (0.342142)
    kurtosis: -1.22485
    skewness: 0.153457
    Image statistics:
    Overall:
    min: 0 (0)
    max: 255 (1)
    mean: 106.595 (0.418019)
    standard deviation: 86.6289 (0.339721)
    kurtosis: -1.16755
    skewness: 0.25694
    Histogram:
    3218: ( 0, 0, 0) #000000 black
    .....
    4: (254,254,255) #FEFEFF rgb(254,254,255)
    935: (255,255,255) #FFFFFF white
    Rendering intent: Undefined
    Interlace: None
    Background color: white
    Border color: rgb(223,223,223)
    Matte color: grey74
    Transparent color: black
    Compose: Over
    Page geometry: 348x36+0+0
    Dispose: Undefined
    Iterations: 0
    Compression: Undefined
    Orientation: Undefined
    Properties:
    date:create: 2011-02-02T19:31:55+01:00
    date:modify: 2011-02-02T19:31:55+01:00
    signature: 1e9223b7fb2697b7ab61fa576c6eca4c9393488f4841b8d283c9048da9c99971
    Artifacts:
    verbose: true
    Tainted: False
    Filesize: 50.2KBB
    Number pixels: 12.5KB
    Pixels per second: 12.51MB
    User time: 0.000u
    Elapsed time: 0:01.001
    Version: ImageMagick 6.6.7-4 2011-01-29 Q16 http://www.imagemagick.org
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to png conversion

Post by fmw42 »

In the above verbose info, IM shows no alpha channel or alpha colors and the type is truecolor and not truecolormatte. So something is odd about the bmp file or IM interpretation of it. What version BMP is it? BMP2, BMP3 or BMP4. See http://www.imagemagick.org/Usage/formats/#bmp
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: bmp to png conversion

Post by indiego »

Sorry, I have no special BMP tool to extract more info. As this graphic is part of the Windows7 Explorer I expect the latest and greatest from MS (probably BMP5). Anyhow, the graphic seems to be valid and it looks like this format is currently not supported in IM. As nobody (except MS) is using this shitty format I can not expect that IM will support it. Gimp works, so I will have to do a manual conversion, one by one.

fmw42, thanks for taking the time to look into it!

-
indiego
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bmp to png conversion

Post by fmw42 »

You should report this to the bugs or developers forum and see what they say.
Post Reply