Created
January 27, 2014 23:08
-
-
Save njt1982/8659208 to your computer and use it in GitHub Desktop.
Make iOS Default Project 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
#!/usr/bin/env bash | |
# Usage: ./resize-default.sh /path/to/folder | |
# | |
# Expects there to be a Source.png which is the [email protected] resolution (1536x2048) | |
# It then generates versions for iPad/iPad Mini and 3 iPhones (5/5S, 4/4S/3GS and 3G/2G) | |
# | |
if [ -z "$1" ]; then | |
echo "USAGE: $0 [PATH]" | |
exit 1 | |
fi | |
cd "$1" | |
# iPad - 1536x2048 | |
F="[email protected]" | |
echo -n "Making ${F}..." | |
cp Source.png "$F" | |
echo "Done" | |
# iPad - 768x1024 | |
F="Default~iPad.png" | |
echo -n "Making ${F}..." | |
cp Source.png "$F" | |
convert "$F" -resize 768x1024 "$F" | |
echo "Done" | |
# iPhone - 640x1136 | |
F="[email protected]" | |
echo -n "Making ${F}..." | |
cp Source.png "$F" | |
convert "$F" -crop 1154x2048+191+0 -resize 640x1136 "$F" | |
echo "Done" | |
# iPhone - 640x960 | |
F="[email protected]" | |
echo -n "Making ${F}..." | |
cp Source.png "$F" | |
convert "$F" -crop 1154x2048+191+0 -resize 640x1136 +repage -crop 640x960+0+88 "$F" | |
echo "Done" | |
# iPhone - 320x480 | |
F="Default.png" | |
echo -n "Making ${F}..." | |
cp Source.png "$F" | |
convert "$F" -crop 1154x2048+191+0 -resize 640x1136 +repage -crop 640x960+0+88 -resize 320x480 "$F" | |
echo "Done" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment