Porting convert command to MagickWand
Posted: 2011-03-28T16:00:17-07:00
Greetings,
I am trying to port this convert command to the MagickWand API:
This is what I am doing, but it does not come out the same:
The main thing I am not sure of is what to use for the composite operator. The command line specifies the operator for the compose command but not for the composite command.
I confirmed that the blur and linear stretch both look the same as what is being performed from the convert command, so that makes me suspect the composite command as well.
Any suggestions would be greatly appreciated!
I am trying to port this convert command to the MagickWand API:
Code: Select all
convert ~/input.png \( +clone -blur 0x6 \) +swap -compose divide -composite -linear-stretch 15%x0% ~/output.png
Code: Select all
// magick_wand contains the input.png data
MagickWand *blur_wand = CloneMagickWand(magick_wand);
MagickBlurImage(blur_wand, 0.f, 6.f);
MagickSetImageCompose(magick_wand, DivideCompositeOp);
float blackPt = rows * cols * 0.15f;
MagickLinearStretchImage(blur_wand, blackPt, 0.f);
MagickCompositeImage(magick_wand, blur_wand, DivideCompositeOp, 0, 0);
blur_wand = DestroyMagickWand(blur_wand);
I confirmed that the blur and linear stretch both look the same as what is being performed from the convert command, so that makes me suspect the composite command as well.
Any suggestions would be greatly appreciated!