Skip to content

Instantly share code, notes, and snippets.

@pablocarrillo
Forked from jessedc/iOS Icon.png bash script
Last active August 29, 2015 14:07
Show Gist options
  • Save pablocarrillo/921a3379ddfa368f4974 to your computer and use it in GitHub Desktop.
Save pablocarrillo/921a3379ddfa368f4974 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This file create a folder called resizedIcons in the same folder than the file
# in the first parameter and place inside all the resized copies
# The filename.png to resize
ITUNES_ARTWORK="$1"
FOLDER0=$(dirname "$ITUNES_ARTWORK")
FOLDER="${FOLDER0}/ResizedIcons"
# create the new folder
mkdir $FOLDER
sips --resampleWidth 512 "$ITUNES_ARTWORK" --out "${FOLDER}/iTunesArtwork.png"
sips --resampleWidth 1024 "$ITUNES_ARTWORK" --out "${FOLDER}/iTunesArtwork@2x.png"
sips --resampleWidth 57 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-57.png"
sips --resampleWidth 114 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-57@2x.png"
sips --resampleWidth 29 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-29.png"
sips --resampleWidth 58 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-29@2x.png"
sips --resampleWidth 87 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-29@3x.png"
sips --resampleWidth 50 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-50.png"
sips --resampleWidth 100 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-50@2x.png"
sips --resampleWidth 40 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-40.png"
sips --resampleWidth 80 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-40@2x.png"
sips --resampleWidth 120 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-40@3x.png"
sips --resampleWidth 57 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-57.png"
sips --resampleWidth 114 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-57@2x.png"
sips --resampleWidth 76 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-76.png"
sips --resampleWidth 152 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-76@2x.png"
sips --resampleWidth 72 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-72.png"
sips --resampleWidth 144 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-72@2x.png"
sips --resampleWidth 120 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-60@2x.png"
sips --resampleWidth 180 "$ITUNES_ARTWORK" --out "${FOLDER}/Icon-60@3x.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment