Hi,
I tried to convert an image to grayscale using C++API. For instance, the original image aaa.bmp is grayscale.
image.segment(size,1.5);
image.type(Magick::BilevelType);
I expect this will give me a binary image, but instead, it generated a pure black image. I also tried to use image.monochrome(); but it didn't work either.
Please advise.
Thanks.
Does BilevelType or monochrome work?
Re:
You don't want to simply change its color type - you want to binarize it. check out Image.threshold() and Image.adaptiveThreshold(), and eventually switch to BilevelType after applying the threshold - Image.write will then produce smaller files.xinito wrote:sorry, i mean to convert the original greyscale image to a binary image.