Skip to content

Instantly share code, notes, and snippets.

@homam
Created October 4, 2016 12:06
Show Gist options
  • Save homam/e5bc58b00ca1234eecf7906f6daef5c3 to your computer and use it in GitHub Desktop.
Save homam/e5bc58b00ca1234eecf7906f6daef5c3 to your computer and use it in GitHub Desktop.
ImageMagick Round a Image - Mask
mkdir -p thumbs
for f in *.jpg; do
size=$(identify -format "%[fx:w]" $f)
sizeh=$(expr $size / 2)
convert -size "$size"x"$size" xc:none -fill $f -draw "fill white circle $sizeh,$sizeh $sizeh,1" thumbs/$f.png
; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment