Skip to content

Instantly share code, notes, and snippets.

@alexisakers
Forked from jessedc/iOS Icon.png bash script
Last active July 5, 2018 04:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexisakers/a71359a8708985176adf3a8bc99763f9 to your computer and use it in GitHub Desktop.
Save alexisakers/a71359a8708985176adf3a8bc99763f9 to your computer and use it in GitHub Desktop.
A simple bash script using OSX command line tool sips to resample a 1024x1024 image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork.png"
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x.png"
sips --resampleWidth 20 "${f}/${1}" --out "${f}/Icon-App-20x20@1x.png"
sips --resampleWidth 40 "${f}/${1}" --out "${f}/Icon-App-20x20@2x.png"
sips --resampleWidth 60 "${f}/${1}" --out "${f}/Icon-App-20x20@3x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-App-29x29@1x.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-App-29x29@2x.png"
sips --resampleWidth 87 "${f}/${1}" --out "${f}/Icon-App-29x29@3x.png"
sips --resampleWidth 40 "${f}/${1}" --out "${f}/Icon-App-40x40@1x.png"
sips --resampleWidth 80 "${f}/${1}" --out "${f}/Icon-App-40x40@2x.png"
sips --resampleWidth 120 "${f}/${1}" --out "${f}/Icon-App-40x40@3x.png"
sips --resampleWidth 120 "${f}/${1}" --out "${f}/Icon-App-60x60@2x.png"
sips --resampleWidth 180 "${f}/${1}" --out "${f}/Icon-App-60x60@3x.png"
sips --resampleWidth 76 "${f}/${1}" --out "${f}/Icon-App-76x76@1x.png"
sips --resampleWidth 152 "${f}/${1}" --out "${f}/Icon-App-76x76@2x.png"
sips --resampleWidth 167 "${f}/${1}" --out "${f}/Icon-App-83_5x83_5@2x.png"
@alexisakers
Copy link
Author

Updated to support Xcode 8 AppIcon assets catalog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment