Changing Bit Depth
Posted: 2007-08-13T08:07:50-07:00
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.
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.