Skip to content

Instantly share code, notes, and snippets.

@ahknight
Last active December 23, 2015 10:58
Show Gist options
  • Select an option

  • Save ahknight/6624740 to your computer and use it in GitHub Desktop.

Select an option

Save ahknight/6624740 to your computer and use it in GitHub Desktop.
Given an input image as the single argument, creates all the files needed for a Universal iOS app (in the same directory, overwriting). Uses pngcrush to compress the images, but that's easily removed/commented out.
#!/bin/bash
function make_icon {
sips -s format png -Z $3 "$1" --out "$2"
pngcrush -ow -q "$2"
}
echo "Using $1 as the base image."
echo "** App Store: iTunesArtwork **"
echo "Creating a 512px version..."
make_icon $1 iTunesArtwork.png 512
echo "Creating a 1024px version..."
make_icon $1 [email protected] 1024
echo "** iPhone: Icon **"
echo "Creating a 57px version..."
make_icon "$1" Icon.png 57
echo "Creating a 114px version..."
make_icon "$1" [email protected] 114
echo "** iPad: Icon-72 **"
echo "Creating a 72px version..."
make_icon "$1" Icon-72.png 72
echo "Creating a 144px version..."
make_icon "$1" [email protected] 144
echo "** iPhone Settings: Icon-Small **"
echo "Creating a 29px version..."
make_icon "$1" Icon-Small.png 29
echo "Creating a 58px version..."
make_icon "$1" [email protected] 58
echo "** iPad Settings: Icon-Small-50 **"
echo "Creating a 50px version..."
make_icon "$1" Icon-Small-50.png 50
echo "Creating a 100px version..."
make_icon "$1" [email protected] 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment