summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--icon/Makefile.am6
-rwxr-xr-xicon/make-png15
2 files changed, 13 insertions, 8 deletions
diff --git a/icon/Makefile.am b/icon/Makefile.am
index 05a4956a..92b5a6e8 100644
--- a/icon/Makefile.am
+++ b/icon/Makefile.am
@@ -38,17 +38,17 @@ clean-local:
$(AM_FILES): altusmetrum.build
-altusmetrum.build: altusmetrum.svg
+altusmetrum.build: altusmetrum.svg make-png
for i in $(RES); do ./make-png altusmetrum.svg $$i altus-metrum-$$i.png; done && touch $@
$(TG_FILES): telegps.build
-telegps.build: telegps.svg
+telegps.build: telegps.svg make-png
for i in $(RES); do ./make-png telegps.svg $$i telegps-$$i.png; done && touch $@
$(MP_FILES): micropeak.build
-micropeak.build: micropeak.svg
+micropeak.build: micropeak.svg make-png
for i in $(RES); do ./make-png micropeak.svg $$i micropeak-$$i.png; done && touch $@
#clean-local:
diff --git a/icon/make-png b/icon/make-png
index bc865d9f..d9dde54e 100755
--- a/icon/make-png
+++ b/icon/make-png
@@ -14,11 +14,17 @@ SIZE=$2
PNG=$3
SHADOW=$(($SIZE / 16))
-IMAGE=$(($SIZE - $SHADOW))
-OPACITY=80
-BLUR=$(($SHADOW / 4))
-SHIFT=$(($SHADOW - $BLUR))
+OPACITY=60
+BLUR=$(($SHADOW / 2))
+
+if [ $BLUR = 0 ]; then
+ BLUR=1
+fi
+
+SHIFT=$(($SHADOW * 3 / 4))
+
+IMAGE=$(($SIZE - $SHIFT - $BLUR))
TMP=image-$$.png
@@ -29,4 +35,3 @@ rsvg-convert -w $IMAGE -h $IMAGE -o $TMP $SVG
convert $TMP \
\( +clone -background black -shadow ${OPACITY}x${BLUR}+${SHIFT}+${SHIFT} \) \
+swap -background none -layers merge -crop ${SIZE}x${SIZE}+0+0 +repage $PNG
-