简体   繁体   中英

ImageMagick: How can I cut out round from image?

I'm trying to make a round avatar out of some image. How can I cut out round from image using ImageMagick?

There are various ways, but the simplest is probably the undocumented "-vignette" option:

magick CLg93.jpg -vignette 1x1 kim_vignette.jpg

yields

在此处输入图片说明

You can deal with non-square images by applying an "offset" to the vignette geometry, for example:

-vignette 1x1+0+50

if the input image is a portrait that is 100 pixels taller than it is wide.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM