Use ImageMagick to place an image inside a larger canvas

前端 未结 7 842
萌比男神i
萌比男神i 2021-01-30 02:46

Getting started with ImageMagic and trying to find a way to do this... If an image is less than 50 pixels tall or 50 pixels wide, I\'d like to place it (un-scaled) in the horizo

7条回答
  •  星月不相逢
    2021-01-30 03:42

    I wanted to do the same, except shrink the image to 70% inside. I used this:

    convert input.png -resize 70%x70% -gravity center -background transparent -extent 72x72 output.png
    

    Not exactly what was requested but hopefully it will help someone ;).

提交回复
热议问题