imagemagick 中的图像圈裁剪

标签 image command-line imagemagick crop

人们,我正在使用 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/

相关文章:

java - Eclipse:从命令行安装一组插件 -> DefaultProfile 不是最新的。预期时间戳

python - python脚本输出末尾的百分号

c# - 将 ImageMagick 和 GhostScript 与 nuget 结合使用

node.js - 如何使用 ImageMagick 或 GraphicsMagick Node.js 从图像中获取哈希值?

iphone - 创建 360 度图像转盘 View Controller ?

php - 如何在MySql表中的某个id处回显图像?

image - 使用 FFMPEG 批量转换一系列单独的图像序列

javascript - 通过AjaxencodeURIComponent发送Base64图像

php - 如何使用 PHP 将文本输出缩进到命令行?

php - 安装 imagemagick Ubuntu 14.04 时遇到错误