Problem converting png to bmp

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
fountainhead
Posts: 2
Joined: 2013-04-09T23:44:44-07:00
Authentication code: 6789

Problem converting png to bmp

Post by fountainhead »

Hello All,

Newbie here. I am having this problem converting a png file to bmp.

The source file is: https://dl.dropbox.com/u/10439810/queries/alarm.png

I used the following code to convert the image:

Code: Select all

convert -depth 24 alarm.png alarm.bmp
But, the problem is that the generated bmp is showing distorted in photoshop ... please see screenshot here:

Image

See the original image looks correct in photoshop:
Image

Please help.

Thanks,
santosh
pipe
Posts: 28
Joined: 2013-04-09T08:32:37-07:00
Authentication code: 6789

Re: Problem converting png to bmp

Post by pipe »

Your exact commandline works for me with ImageMagick 6.7.7-10 and 6.8.3-9. Maybe photoshop can't handle transparency in BMP images? Works great in gimp. According to the internet, transparency in bmp images are non-standard.

ps. This question should probably go to the user part of the forum?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem converting png to bmp

Post by snibgo »

Your "-depth 24" is wrong, unless you have a non-standard version of IM that can process 24 bit per channel per pixel.

You might try the BMP2 and BMP3 formats:

Code: Select all

convert alarm.png BMP2:alarm2.bmp
convert alarm.png BMP3:alarm3.bmp
snibgo's IM pages: im.snibgo.com
fountainhead
Posts: 2
Joined: 2013-04-09T23:44:44-07:00
Authentication code: 6789

Re: Problem converting png to bmp

Post by fountainhead »

Thank you Pipe. You pointed me in the right direction.
The transparency was the problem. I used flatten and everything seems fine now!

Thank you!
Santosh
Post Reply