Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crop down to circle

I would like to crop a rectangular image down to a circle. I ran this command:

convert -crop 500x500+100+100 in.jpg out.jpg

However it creates a square rather than a circle.


1 Answers

convert in.jpg -extent 400x400+100+100 \
  '(' +clone -alpha transparent -draw 'circle 200,200 200,0' ')' \
  -compose copyopacity -composite out.png

This +100+100 part is optional: it allows you to shift the viewport.

How to make circle thumbnail with GraphicsMagick?