I am reading in a grayscale image, but it seems like somehow the wand is reading it as an RGB image.
The reason I suspect this is because if I run this:
Code: Select all
MagickLevelImageChannel(magick_wand2, GrayChannel, (0.5f * QuantumRange), 0.6666f, (0.8f * QuantumRange));
I have tried reading the image two ways, as a PNG:
Code: Select all
status = MagickReadImageBlob(origWand, [dataObject bytes], [dataObject length]);
Code: Select all
status = MagickConstituteImage(origWand, width, height, "I", CharPixel, [dataObject bytes]);
Code: Select all
MagickSetImageType(origWand, GrayscaleType);
MagickSetImageColorspace(origWand, GRAYColorspace);
Note that if I write the wand out and open the file, it is in fact a grayscale, single channel image:
Code: Select all
status = MagickWriteImage(origWand, "out.png");