【问题标题】:ImageMagick Crop Square from Circle?来自Circle的ImageMagick Crop Square?
【发布时间】:2012-02-20 01:36:16
【问题描述】:

我有一个 424x318 的图像,我在其中“画”了一个圆圈,其余部分保持透明。然后我想把那个圆圈剪掉。我该怎么做?

我的函数(bash 变量只是普通的东西,$SCALEFILE 是文件,$NEWFILE 是它保存的内容,$SIZE 只是普通大小的字符串 x0,y0 x1,y1)

convert -size 416x318 xc:none -fill $SCALEFILE -draw "circle $SIZE" $NEWFILE

ps。我的圈子尺寸发生了变化。

谢谢!

【问题讨论】:

    标签: php bash imagemagick crop


    【解决方案1】:

    你可以使用-crop WxH+X+Y +repage 裁剪到圆圈。

    例如:

    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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-28
      • 2016-10-01
      • 2010-12-13
      • 2014-06-09
      • 2015-04-05
      相关资源
      最近更新 更多