使用Imagemagick,如何裁剪出白色背景? [英] Using Imagemagick, how do I crop out the white background?

查看:180
本文介绍了使用Imagemagick,如何裁剪出白色背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个满是旗帜的目录(200左右)。每个标志都有这个边框... 12px向上和向下,1px左边和rigtht ....就像这样:

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:

我如何使用imagemagick来...裁剪每一个.PNG图像从64x64到60x40

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

推荐答案

你有自动裁剪: mogrify -trim flag.png 。如果它不能达到您想要的精确魔法,请使用裁剪: mogrify -crop 60x40 + 2 + 12 flag.png (即 2 像素左)。

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).

这篇关于使用Imagemagick,如何裁剪出白色背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆