ImageMagick: How can I cut out round from image?

250 views Asked by At

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

1

There are 1 answers

1
Glenn Randers-Pehrson On BEST ANSWER

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

magick CLg93.jpg -vignette 1x1 kim_vignette.jpg

yields

enter image description here

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.