Created
October 6, 2014 21:39
-
-
Save jamesmccann-zz/bd755073d2a600fd1ac2 to your computer and use it in GitHub Desktop.
Android asset resize script (run inside a folder of 3x images).
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/bash -e | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
mkdir ./drawable-mdpi | |
mkdir ./drawable-hdpi | |
mkdir ./drawable-xhdpi | |
mkdir ./drawable-xxhdpi | |
for f in *; do | |
if [[ $f == *.png ]]; | |
then | |
echo "...$f" | |
convert $f -resize 33.3% ./drawable-mdpi/$f | |
convert $f -resize 50.0% ./drawable-hdpi/$f | |
convert $f -resize 66.67% ./drawable-xhdpi/$f | |
convert $f -resize 100.0% ./drawable-xxhdpi/$f | |
fi | |
done | |
echo "Complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment