Converting image to Grayscale
Posted: 2012-03-28T14:00:18-07:00
Hello,
I'm fairly new to ImageMagick and I am wandering if there's an easy want to convert a normal RGB image to Grayscale. What I need to do is read the image from a file convert it into the grayscale version and write it back. Is there any MagickWand methods to do this. I've been looking through the internet but I can't seem to find how to do it.
I just read the image like this
But now what method or technique can I use to convert is? Thanks for the help!
I'm fairly new to ImageMagick and I am wandering if there's an easy want to convert a normal RGB image to Grayscale. What I need to do is read the image from a file convert it into the grayscale version and write it back. Is there any MagickWand methods to do this. I've been looking through the internet but I can't seem to find how to do it.
I just read the image like this
Code: Select all
MagickWandGenesis();
image_wand=NewMagickWand();
status=MagickReadImage(image_wand,file);