Use ImageMagick to place an image inside a larger canvas

前端 未结 7 934
萌比男神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 have once used this code to place an image in the center of a new canvas with white background. hope this will help you

    convert -background white -gravity center your_image.jpg -extent 50x50 new_image.jpg
    

提交回复
热议问题