人们,我正在使用 imagemagick 从图像中裁剪出一个圆圈。但是当我运行这个命令时我什么也没得到:
convert input.jpg +clone -threshold -1 -negate -fill white -draw "circle 539,539 539,0" -alpha off -compose copy_opacity -composite output_circ.jpg
我得到类似 this 的输出:
如果我遗漏了什么,请告诉我。
最佳答案
从根本上说,您只缺少一个方面 - JPEG 文件无法存储透明度,因此您需要使用例如 PNG 或 GIF。
convert input.jpg -alpha on \( +clone -threshold -1 -negate -fill white -draw "circle 539,539 539,0" \) -compose copy_opacity -composite output_circ.png
关于imagemagick 中的图像圈裁剪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40478844/