Convert bmp to jpeg

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
Pravin

Convert bmp to jpeg

Post by Pravin »

Hi, I am new at ImageMagicK.
I am trying to convert bmp file to jpeg using command line utility.
I am using following commnad for the same.
convert "test.bmp" -resize 1024x768 -density 72 -depth 24 -Quality 72 "test.jpeg"

It results in test.jpeg but in complete black color.

Here are the details of test.bmp
Width: 1280 pixels
height: 1024 pixels
Horizontal resolution: 96 dpi
Vertical resolution: 96 dpi
Bit depth: 32
Frame count: 1

If I removed the "resize" option or provide with exactly same as bmp then it works fine.

Please let me know what is wrong in this conversion?

Thanks.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Convert bmp to jpeg

Post by Bonzo »

I would say you have a conflict of options and would start with the basics and expand to see where the problem is.

Code: Select all

convert test.bmp -resize 1024x768 test.jpeg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert bmp to jpeg

Post by fmw42 »

what version of IM

convert -list configure

report what version and what quantum-depth

Note depth is the depth per channel. I don't think 24 is supported. If you are using IM quantum depth 8, your only choice is 8, or 1 (binary). If quantum depth 16, then 16, 8, 1. If quantum-depth 32, then 32, 16, 8 or 1.

IM folks can correct me if I am wrong.
Pravin

Re: Convert bmp to jpeg

Post by Pravin »

Hi,

I have tried the only resize option. It is not working.

convert test.bmp -resize 1024x768 test.jpeg.

It works with other options.
convert "test.bmp" -density 72 -depth 24 -quality 72 "test.jpeg"

so I think issue is with resize option.

I am using IM 6.5.3.
Operating System: WindowsXp

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

Re: Convert bmp to jpeg

Post by fmw42 »

post your bmp image so others can test/check it.

I am no expert of bmp images, but read http://www.imagemagick.org/Usage/formats/#bmp
Post Reply