从金环ImageMagick的作物广场? [英] ImageMagick Crop Square from Circle?

查看:172
本文介绍了从金环ImageMagick的作物广场?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个424x318的图像,我画一个圆进入和离开休息透明。我想然后采取圆和裁剪出来。我怎样才能做到这一点?

I have a 424x318 image that I "draw" a circle into and leave the rest transparent. I want to then take that circle and crop it out. How can I do this?

我的功能(bash的变量,都只是正常的东西,$ SCALEFILE是文件,$ NEWFILE是它并将其作为和$ SIZE仅仅是正常大小的字符串X0,Y0 X1,Y1)

My function (the bash variables are just the normal stuff, $SCALEFILE is the file, $NEWFILE is what it saves it as and $SIZE is just the normal size string x0,y0 x1,y1)

转换-size 416x318 XC:无-fill $ SCALEFILE -draw圈子$ SIZE$ NEWFILE

PS。我的圈子尺寸改变。

ps. my circle dimensions change.

谢谢!

推荐答案

您可以使用-crop宽x高+ X + Y + repage裁剪到圆。

You can use -crop WxH+X+Y +repage to crop to the circle.

例如:

convert -size 300x300 xc:transparent -fill "image.png" -draw "circle 240,90 290,90" -crop 100x100+190+40 +repage circle1.png
convert -size 300x300 xc:transparent -fill "image.png" -draw "circle 70,90 110,90" -crop 100x100+20+40 +repage circle2.png

这篇关于从金环ImageMagick的作物广场?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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