Magick++ bitdepth for monochrome BMP

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
xdaiana
Posts: 3
Joined: 2014-01-24T09:51:21-07:00
Authentication code: 6789

Magick++ bitdepth for monochrome BMP

Post 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
xdaiana
Posts: 3
Joined: 2014-01-24T09:51:21-07:00
Authentication code: 6789

Re: Magick++ bitdepth for monochrome BMP

Post 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.
Post Reply