Crop or mask an image into a circle

pix0r picture pix0r · Jun 16, 2009 · Viewed 20.7k times · Source

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)

Answer

tom picture tom · Jun 16, 2009

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

walter alt text