Code: Select all
mw_logo = NewMagickWand();
status = MagickReadImage(mw_logo, argv[2]); // read logo
if (status == MagickFalse)
ThrowWandException(mw_logo);
mw_r = CloneMagickWand(mw_logo);
mw_g = CloneMagickWand(mw_logo);
mw_b = CloneMagickWand(mw_logo);
mw_a = CloneMagickWand(mw_logo);
MagickSeparateImageChannel(mw_r, RedChannel);
MagickSeparateImageChannel(mw_g, GreenChannel);
MagickSeparateImageChannel(mw_b, BlueChannel);
MagickSeparateImageChannel(mw_a, AlphaChannel);
MagickWriteImage(mw_r, "/tmp/SRr.png");
MagickWriteImage(mw_g, "/tmp/SRg.png");
MagickWriteImage(mw_b, "/tmp/SRb.png");
MagickWriteImage(mw_a, "/tmp/SRa.png");
Thanks for helping!
PS: Sorry, I posted here first in the MagickWand forum...