Using Imagemagick, how do I crop out the white background?

半腔热情 提交于 2019-12-10 15:54:24

问题


Let's say I have a directory full of flags (200 or so). Each flag has this border... 12px up and down and 1px left and rigtht.... like so:

How can I use imagemagick to like... crop every single .PNG image from 64x64 to 60x40


回答1:


You have the automatic crop: mogrify -trim flag.png. If it does not do the exact magic you want, use crop: mogrify -crop 60x40+2+12 flag.png (That is 2 pixels left).



来源:https://stackoverflow.com/questions/14098965/using-imagemagick-how-do-i-crop-out-the-white-background

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!