0

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

Kim
  • 5,045
  • 6
  • 38
  • 60

1 Answers1

3

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.

Glenn Randers-Pehrson
  • 11,940
  • 3
  • 37
  • 61
  • I'd probably just crop or resize the input image to create a square image to work with, but in fact the `-vignette` geometry parameter can deal with it -- see the added information about that above. – Glenn Randers-Pehrson Dec 25 '16 at 01:20