I am trying to convert an ImageMagick command for a blurring mask to Magick++ API.
ImageMagick:
convert -size 720x478 xc: -sparse-color Barycentric '0,0 black 0,%h white' -function polynomial 4,-4,1 -level 0,50% mask.jpg
Magick++:
Magick::Image mask(Magick::Geometry(720,478), Magick::Color("white"));
double args[6];
args[0] = 0;
args[1] = 0;
args[2] = 0;
args[3] = 0;
args[4] = mask.rows();
args[5] = MaxRGB;
mask.sparseColor(Magick::DefaultChannels, Magick::BarycentricColorInterpolate, 6, args);
args[0] = 4;
args[1] = -4;
args[2] = 1;
args[3] = 0;
args[4] = 0;
args[5] = 0;
mask.quantumOperator(Magick::DefaultChannels, Magick::PolynomialFunction,
3,args);
parseLevel(image, "0,50%", args); // contains code from mogrify.c for parsing the leveling string
mask.level(args[0], args[1], args[2], ' ');
The result I get is just a white image, whereas the correct mask image should be like this:
Can someone please show me my mistake?