Can't change bit depth of image in magick++
Posted: 2019-01-08T07:48:18-07:00
I'm generating an image from the Pixel data array in magick++ :
Then, converting it to grayscale :
Then, writing the image :
On measuring the image, it shows bit-depth of 4 Pixel.
I tried, after the quantization steps, but still Bit-depth remains 4 bit.
Can anyone please tell me, where I'm going wrong.
Code: Select all
image.read(4096,4096, "R", CharPixel, pixelArrayPointer);
image.read(4096,4096, "G", CharPixel, pixelArrayPointer);
image.read(4096,4096, "B", CharPixel, pixelArrayPointer);
Code: Select all
image.quantizeColorSpace(GRAYColorspace);
image.quantizeColors(256);
image.quantize();
Code: Select all
image.write("my_image.bmp");
I tried,
Code: Select all
image.channelDepth(ChannelType:GrayChannel, 8);
Can anyone please tell me, where I'm going wrong.