Search code examples
image-processingimagemagickimagemagick-convert

Imagemagick: After centering image, move it left by 50px


I am currently centering an image on a white background like below:

... -gravity center -background white -extent 400x400 ...

I find that after centering, I need to move the image (~250x250, can vary slightly) to the left of the center by 50px. How can I achieve this?

I tried using -geometry after -gravity center but that doesn't work.


Solution

  • Try

    convert ... -gravity center -background white -extent 400x400+50+0 ...
    

    Where the ImageMagick documentation talks about "geometry" in this context, it's talking about the "geometry string" associated with the "-extent" option, not about a "-geometry" option.