I'm trying to recode below command into C. Everything seems to be fine except gravity. I don't know why it's not working. My original image is 2000x834
. I also attached the original image and it's result of both images.
1. convert single_color.png -quiet single_color.png +repage -gravity center -background none -extent 4000x834 single_colorM.png
Below is C code.
MagickWand *wand;
MagickReadImage(wand, "single_color.png");
PixelWand *PW1;
PW1 = NewPixelWand();
PixelSetColor(PW1,"none");
// For 1st Command
MagickResetImagePage(wand,"4000x834+0+0");
MagickSetImageGravity(wand, CenterGravity);
MagickSetImageBackgroundColor(wand, PW1);
MagickExtentImage(wand,pwidth, pheight,0,0);
MagickWriteImage(wand,"single_color1M.png");
Original Image Command Modified Image C Program Modified Image
But if I pass X and Y parameters to MagickExtentImage(wand,pwidth, pheight,0,0);
then I can able to adjust it's gravity.
This question was also posted to the ImageMagick User Forum.
See the answer at
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=31788