3 # Insert date, make the selected gametype symbol visible,
4 # then render and optimize png files of the three medals.
8 # pngquant (Reduces colors to 8bit)
9 # optipng (Removes unnecessary data)
10 # advpng (Compresses with zopfli algorithm)
13 # $0 SIZE(2^n, optimal=64)
14 # GAMETYPE(ca|ctf|cts|dm|dom|duel|ft|insta|ka|kh|lms|nb|ons|tdm|xonotic) \
15 # MONTH(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \
28 for num in "1" "2" "3"; do
30 png="png/$size-$type-$year-${month,,}-$num.png"
33 sed -e "s|width=\"64\" height=\"64|width=\"$size\" height=\"$size|" \
34 -e "s|id=\"$type\" opacity=\"0|id=\"$type\" opacity=\"1|" \
36 -e "s|YY|$year|" "$svg" |\
37 convert -background none - "$png"
40 pngquant --nofs --speed 1 --quality 70-75 --skip-if-larger --force --output "$png" "$png"
41 optipng -o 5 -strip all "$png"
42 advpng --recompress --shrink-insane -i 1000 "$png"