gray scale image with Magick++ API
Posted: 2009-12-03T00:59:50-07:00
Hi,
I tried to convert color images to gray images with the following code:
Magick::Image image;
image.read("color.jpg");
image.colorSpace(GRAYColorspace);
image.write("gray.jpg");
The resulted image seems to be exactly as the original image. What's wrong with my code?
Thank you for your help in advance.
I also tried this without success:
Magick::Image image;
image.read("color.jpg");
image.monochrome(true);
image.write("gray.jpg");
I tried to convert color images to gray images with the following code:
Magick::Image image;
image.read("color.jpg");
image.colorSpace(GRAYColorspace);
image.write("gray.jpg");
The resulted image seems to be exactly as the original image. What's wrong with my code?
Thank you for your help in advance.
I also tried this without success:
Magick::Image image;
image.read("color.jpg");
image.monochrome(true);
image.write("gray.jpg");