Created
March 1, 2013 16:45
-
-
Save johannilsson/5065953 to your computer and use it in GitHub Desktop.
Quick and dirty tile sprite image from a set of pngs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo Creating output. | |
rm -rfv out | |
mkdir -vp out | |
echo Making tiled version. | |
montage *.png -tile x1 -geometry '1x1+0+0<' -alpha On -background transparent -quality 100 out/out.png | |
echo Making tiled debug version | |
montage -label '%t\n%[width]x%[height]' -font 'Arial' *.png -tile x1 -geometry '1x1+0+0<' -alpha On -background transparent -quality 100 out/out-debug.png | |
echo Running optipng | |
optipng out/out.png -out out/out-opt.png | |
optipng out/out-debug.png -out out/out-debug-opt.png | |
# Get tile dimensions | |
FILE=`ls | grep -m1 png` | |
FILE_DATA=`identify $FILE` | |
DIMENSTION=`echo $FILE_DATA | cut -d" " -f3` | |
WIDTH=`echo $DIMENSTION | cut -dx -f1` | |
HEIGHT=`echo $DIMENSTION | cut -dx -f2` | |
echo w: $WIDTH, h: $HEIGHT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment