Discussion:
save bmp in indexed mode
Matthew Gibson
2011-02-05 20:33:58 UTC
Permalink
Hello,

I am using imagemagick in c++ (Magick++) to generate a bmp. I want the
bitmap to be saved to a file in indexed mode, for use as my computer's boot
splash. I want to know how to use ImageMagick to save an indexed bitmap.

This is the first thing I've ever done with image magick - I was glad it was
so easy. I am using it something like this:

Magick::Image my_img(img_path);
...
my_img.write("file.bmp");

This saves an RGB bitmap.

I took a look at the code to figure out color space, etc. but havn't been
able to figure that out.

Thanks for any help,

Matthew
Wolfgang Hugemann
2011-02-07 11:02:03 UTC
Permalink
If this is your first try on ImageMagick, you should better use the
command line tools to figure out how things work. Basically, you have to
set the number of colours in your image, so the right command line is

convert test.jpg -colors 256 test.bmp

an you'll get a 256 colours bitmap as a result.

Wolfgang Hugemann

Loading...