将图像裁剪或遮盖成圆形 [英] Crop or mask an image into a circle

查看:97
本文介绍了将图像裁剪或遮盖成圆形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ImageMagick或GD库将图像裁剪或遮罩成圆形的最佳方法是什么? (注意,解决方案存在于其他Q& A站点,但不存在StackOverflow)

What is the best way to crop or mask an image into a circular shape, using either ImageMagick or GD libraries? (Note, solution exists on "other" Q&A sites, but not StackOverflow)

推荐答案

以下是ImageMagick的一种方法将在不使用面具的情况下完成此操作:

Here is one way with ImageMagick that will acomplish this without using a mask:

convert -size 200x200 xc:none -fill walter.jpg -draw "circle 100,100 100,1" circle_thumb.png


这篇关于将图像裁剪或遮盖成圆形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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