MagickExportImagePixels for BiLevel image
Posted: 2014-04-11T02:54:23-07:00
Greeting.
I have a PNG image that I have quantized to BievelType. Now I would like to get access to this raw image. so I use MagickExportImagePixels() api to get access to this raw image. However, I am not sure what should be the map and the storage type? If I use "I" for map (grayscale) and storage as PixelChar, the api crashes because it expects the allocated memory to be (width * height) bytes whereas I am providing (width * height)/8 bytes.
Any suhhestions on how to use MagickExportImagePixels() api to extract Bilevel image?
I have a PNG image that I have quantized to BievelType. Now I would like to get access to this raw image. so I use MagickExportImagePixels() api to get access to this raw image. However, I am not sure what should be the map and the storage type? If I use "I" for map (grayscale) and storage as PixelChar, the api crashes because it expects the allocated memory to be (width * height) bytes whereas I am providing (width * height)/8 bytes.
Any suhhestions on how to use MagickExportImagePixels() api to extract Bilevel image?