Page 1 of 1

Magick++ bitdepth for monochrome BMP

Posted: 2014-01-24T10:07:45-07:00
by xdaiana
Hello folks,

I cannot manage to transform a monochrome tiff loaded from disk in an Image object into a bitmap with 1 bit per pixel.
I'm using Magick++, not the command line tool.
I tried with

Code: Select all

image.depth(1)
also with

Code: Select all

image.type(BilevelType)

when getting the depth it was correct, but after writing the image on disk

Code: Select all

image.write("bla.bmp")
the image had 24 bits per pixel.

Is there any restriction that I'm missing? Because from command line it worked...

Thank you
Daiana

Re: Magick++ bitdepth for monochrome BMP

Posted: 2014-01-27T04:48:40-07:00
by xdaiana
seems that setting the depth does not function at all :(
I managed to reduce bitdepth using quantize, but as far as I understood this function always optimizes the depth, so if I'm asking for a RGB image but the input content is B/W or grayscale I will not get the resulting bitdepth I need.