Last active
August 29, 2015 13:57
-
-
Save 3zcurdia/9380776 to your computer and use it in GitHub Desktop.
script to automate the sprite image generation using image magick and pngcrush
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
mkdir revised; | |
for file in *.png; do | |
filename=${file%.*} | |
ext=${file#*.} | |
mogrify -resize 128x128 -density 72 -units PixelsPerInch -write revised/$filename.128.$ext $file; | |
mogrify -resize 64x64 -density 72 -units PixelsPerInch -write revised/$filename.64.$ext $file; | |
mogrify -resize 32x32 -density 72 -units PixelsPerInch -write revised/$filename.32.$ext $file; | |
done | |
montage revised/*.png -geometry +2+2 -background 'rgba(0,0,0,0)' sprites.png | |
pngcrush sprites.png sprites-optimized.png; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment