Created
October 18, 2013 07:26
-
-
Save johannilsson/7037732 to your computer and use it in GitHub Desktop.
Make a sprite & a debug sprite of a set of png image.
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 | |
FRAMES=`ls *.png | wc -l` | |
echo $FRAMES Frames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment