public
Created

How to crop an image down to a square thumbnail

  • Download Gist
gistfile1.sh
Shell
1 2 3 4 5
# takes image and fits to a square, cutting off edges
convert original.jpg -thumbnail 150x150^ -gravity Center -extent 150x150 new.jpg
 
# takes image and fits to a square, specified by bounds
convert -extract 200x200+250+0 -thumbnail 150x150^ -extent 150x150 -strip original.jpg new.jpg

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.