Skip to content

Instantly share code, notes, and snippets.

@sarah-j-smith
Created November 7, 2016 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarah-j-smith/bfcbe7d04f58d72c33d7ff1f436f46d2 to your computer and use it in GitHub Desktop.
Save sarah-j-smith/bfcbe7d04f58d72c33d7ff1f436f46d2 to your computer and use it in GitHub Desktop.
Produce a set of icons for an iOS app from a PNG image.
#!/bin/sh
SIZES="58 87 80 120 180 29 20 40 60 76 158 152 167"
OUTBASENAME=$(basename "$1" .png)
for sz in $SIZES; do
newImage="${OUTBASENAME}-${sz}x${sz}.png"
cp "$1" "$newImage"
sips --resampleHeightWidth $sz $sz "$newImage"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment