Converting a 32bit BMP to PNG and preserve alpha channel

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

Re: Converting a 32bit BMP to PNG and preserve alpha channel

Post by fmw42 »

swidnikk wrote:I can't seem to figure this out (been experimenting with some of the examples at http://www.imagemagick.org/Usage/channels/#extract)

I have 32bit(RGBA) BMP images and need to convert those to PNG while preserving the alpha information (for display on the web).

Can anyone point me in the right direction?

I've been trying things like the following with no success...

Code: Select all

convert image.bmp -alpha extract image_extract.png
convert image.bmp image.png

should do it, but if not try

convert image.bmp -channel rgba -alpha on image.png

Post a link to your image, if this does not work. Perhaps your image is not what you think. You can check its characteristics by

identify -verbose image.bmp

and check if the alpha channel exists
Post Reply