Changing Bit Depth

ImageMagickObject is a Windows COM+ interface to ImageMagick. COM+, Visual Basic, and Delphi users should post to this discussion group.
Post Reply
cd_tim

Changing Bit Depth

Post by cd_tim »

I'm creating a bitmap from scratch, and the colours used will be minimal, so I'd like to use a bit depth of 8. I have tried to do this using the Image.quantize method, but the created bitmap has a bit depth of 32.

I have been able to create a bitmap with bit depth of 1 using the following code.

Magick::Image image;
image.size(Magick::Geometry(300, 300));

image.quantizeColorSpace(Magick::GRAYColorspace));
image.quantizeColors(256);
image.quantize();

Unfortunately, when I draw anything, the bit depth goes back to 32.

Any assistance would be appreciated.
Post Reply