From: Keith Packard Date: Sun, 15 Jun 2014 01:34:09 +0000 (-0700) Subject: icon: Make the icon shadows a bit less harsh X-Git-Tag: 1.4~17 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=23708b4760250f55e8e3b1a0141df9a9ee17a936 icon: Make the icon shadows a bit less harsh Signed-off-by: Keith Packard --- 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 -