BMP compression with convert

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
sharvey

BMP compression with convert

Post by sharvey »

I am running into something strange when I use convert to change an uncompressed .bmp file into a compressed .bmp file. I use the command:

convert in.bmp -colors 256 out.bmp

which should use the RLE compression that is default for .bmp files. I also tried:

convert in.bmp -colors 256 -compress RLE out.bmp

but in both cases, the compressed image ended up being about twice the size of the original, when it of course should have been smaller. Would anyone be able to explain what's going on? I am using Image Magick 6.5.3 on Ubuntu.

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

Re: BMP compression with convert

Post by fmw42 »

If you are on a Q16 install of IM, then add -depth 8 to your command
sharvey

Re: BMP compression with convert

Post by sharvey »

Thanks for the idea, but I'm using a Q8 install. And after some further investigation, it seem that the images I'm using are not well suited for RLE compression, so the extra compression data ends up making the file larger instead of smaller.
Post Reply