Created
August 24, 2018 16:50
-
-
Save jasonmerino/515c535766f566cab833ef8a367ecaf2 to your computer and use it in GitHub Desktop.
An icon resizing script for iOS projects.
This file contains hidden or 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
#!/bin/bash | |
# About | |
# This script will resize your original app icon into all needed | |
# icon sizes. Images will be created in the same folder as this | |
# script. From there you just need to drag them to the appropriate | |
# image locations in Xcode. | |
# | |
# Usage | |
# 1. Move this script and your source image into the same directory. | |
# 2. Make sure this script is executable with `chmod +x icon-resizer.sh`. | |
# 3. Call script with `./icon-resizer.sh originalAppIcon.png` | |
f=$(pwd) | |
# 20 | |
sips --resampleWidth 20 "${f}/${1}" --out "${f}/AppIcon20.png" | |
sips --resampleWidth 40 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 60 "${f}/${1}" --out "${f}/[email protected]" | |
# 29 | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/AppIcon29.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 87 "${f}/${1}" --out "${f}/[email protected]" | |
# 40 | |
sips --resampleWidth 40 "${f}/${1}" --out "${f}/AppIcon40.png" | |
sips --resampleWidth 80 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 120 "${f}/${1}" --out "${f}/[email protected]" | |
# 60 | |
sips --resampleWidth 120 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 180 "${f}/${1}" --out "${f}/[email protected]" | |
# 76 | |
sips --resampleWidth 76 "${f}/${1}" --out "${f}/AppIcon76.png" | |
sips --resampleWidth 152 "${f}/${1}" --out "${f}/[email protected]" | |
# 83.5 | |
sips --resampleWidth 167 "${f}/${1}" --out "${f}/[email protected]" | |
# 1024 | |
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/AppIcon1024.png" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment