Resize to fit in a box and set background to black on “empty” part

后端 未结 1 1249
刺人心
刺人心 2021-01-11 13:12

I\'m trying to obtain this result: fixed box size (133x100), the image should be resized but not stretched to fit inside that box, the empt

相关标签:
1条回答
  • 2021-01-11 13:41

    Looks like I've found the solution by myself with this link: http://www.imagemagick.org/Usage/thumbnails/#fit_summery

    And this code solved my issue:

    convert from.jpg -thumbnail 133x100 -background black -gravity center -extent 133x100 to.jpg
    
    0 讨论(0)
提交回复
热议问题