From f74a3cc8ab528b95d6bf07c0209140c2da02d25c Mon Sep 17 00:00:00 2001 From: Severin Meyer Date: Thu, 24 Mar 2016 19:01:34 +0100 Subject: [PATCH] Add sources of medal icons for xonstat --- gfx/medals/duel1.svg | 63 ++++++++++++++++++++++++++++++++++++++++++++ gfx/medals/duel2.svg | 61 ++++++++++++++++++++++++++++++++++++++++++ gfx/medals/duel3.svg | 59 +++++++++++++++++++++++++++++++++++++++++ gfx/medals/render.sh | 30 +++++++++++++++++++++ 4 files changed, 213 insertions(+) create mode 100644 gfx/medals/duel1.svg create mode 100644 gfx/medals/duel2.svg create mode 100644 gfx/medals/duel3.svg create mode 100755 gfx/medals/render.sh diff --git a/gfx/medals/duel1.svg b/gfx/medals/duel1.svg new file mode 100644 index 0000000..d7c892c --- /dev/null +++ b/gfx/medals/duel1.svg @@ -0,0 +1,63 @@ + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/duel2.svg b/gfx/medals/duel2.svg new file mode 100644 index 0000000..e2ddd12 --- /dev/null +++ b/gfx/medals/duel2.svg @@ -0,0 +1,61 @@ + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/duel3.svg b/gfx/medals/duel3.svg new file mode 100644 index 0000000..219f0f9 --- /dev/null +++ b/gfx/medals/duel3.svg @@ -0,0 +1,59 @@ + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/render.sh b/gfx/medals/render.sh new file mode 100755 index 0000000..75cd7f9 --- /dev/null +++ b/gfx/medals/render.sh @@ -0,0 +1,30 @@ +#!/bin/sh -e +# TASK +# Insert date, render all svg files +# and compress the resulting png files. +# +# DEPENDENCIES +# convert +# pngquant (Reduces colors to 8bit) +# optipng (Removes unnecessary data) +# advpng (Compresses with zopfli algorithm) +# +# USAGE +# ./render.sh MONTH(MMM) YEAR(YY) + + +month="$1" +year="$2" + + +mkdir -p "png" + + +for svg in *.svg; do + png="png/${svg%.*}.png" + + sed -e "s|MMM|$month|" -e "s|YY|$year|" "$svg" | convert -background none - "$png" + pngquant --nofs --speed 1 --quality 70-75 --skip-if-larger --force --output "$png" "$png" + optipng -o 5 -strip all "$png" + advpng --recompress --shrink-insane -i 1000 "$png" +done -- 2.39.2