Skip to content

Instantly share code, notes, and snippets.

@Wikinaut
Created February 26, 2022 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wikinaut/2572b0300464948ed06c9133d932e285 to your computer and use it in GitHub Desktop.
Save Wikinaut/2572b0300464948ed06c9133d932e285 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# create a semi-transparent circle image with an annotation text
echo "circle <text> <circlesize> <fillcolor> <opacity>"
magick -size "$2"x"$2" \
xc:none -stroke black -strokewidth 2 -fill "$3" \
-draw 'circle %[fx:w/2],%[fx:h/2] %[fx:w/2],%[fx:h]' \
-alpha set -channel A -evaluate Multiply "$4" +channel \
-set pt %[fx:h/1.5] \
-set ofs %[fx:h/18] \
-pointsize %[pt] -gravity center -fill black -annotate +0+%[ofs] "$1" \
"circle-${1}.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment