Page 1 of 1

BMP compression with convert

Posted: 2009-07-13T13:31:29-07:00
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.

Re: BMP compression with convert

Posted: 2009-07-13T16:10:00-07:00
by fmw42
If you are on a Q16 install of IM, then add -depth 8 to your command

Re: BMP compression with convert

Posted: 2009-07-14T06:26:26-07:00
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.