Skip to content

Instantly share code, notes, and snippets.

@antongaenko
Last active December 24, 2016 23:43
Show Gist options
  • Save antongaenko/8fa383eb690ac6dd0601 to your computer and use it in GitHub Desktop.
Save antongaenko/8fa383eb690ac6dd0601 to your computer and use it in GitHub Desktop.
Resize big icon to make iOS 7+ icon set
#!/bin/sh
# Generate icons for >= iOS 7
#
# Install
# curl -o /usr/local/bin/resize_ios_icons -O https://gist.githubusercontent.com/Just-/8fa383eb690ac6dd0601/raw/36d49d9c2deda6844776abbaf0da127759176d2c/resize_ios_icons.sh && chmod +x /usr/local/bin/resize_ios_icons
#
# Params: 1 - icon to resize (fe 512px or 1024px)
# 2 - dir to generate
#
GENERATED_DIR="${2:-generated-resources}"
mkdir ${GENERATED_DIR}
sips $1 -Z 29 -o ${GENERATED_DIR}/settings.png
sips $1 -Z 58 -o ${GENERATED_DIR}/settings@2x.png
sips $1 -Z 87 -o ${GENERATED_DIR}/settings@3x.png
sips $1 -Z 40 -o ${GENERATED_DIR}/spotlight.png
sips $1 -Z 80 -o ${GENERATED_DIR}/spotlight@2x.png
sips $1 -Z 120 -o ${GENERATED_DIR}/spotlight@3x.png
sips $1 -Z 60 -o ${GENERATED_DIR}/iPhone.png
sips $1 -Z 120 -o ${GENERATED_DIR}/iPhone@2x.png
sips $1 -Z 180 -o ${GENERATED_DIR}/iPhone@3x.png
sips $1 -Z 76 -o ${GENERATED_DIR}/iPad.png
sips $1 -Z 152 -o ${GENERATED_DIR}/iPad@2x.png
sips $1 -Z 167 -o ${GENERATED_DIR}/iPadPro@2x.png
sips $1 -Z 48 -o ${GENERATED_DIR}/AppIcon24x24@2x.png
sips $1 -Z 55 -o ${GENERATED_DIR}/AppIcon27.5x27.5@2x.png
sips $1 -Z 58 -o ${GENERATED_DIR}/AppIcon29x29@2x.png
sips $1 -Z 87 -o ${GENERATED_DIR}/AppIcon29x29@3x.png
sips $1 -Z 80 -o ${GENERATED_DIR}/AppIcon40x40@3x.png
sips $1 -Z 88 -o ${GENERATED_DIR}/AppIcon44x44@2x.png
sips $1 -Z 172 -o ${GENERATED_DIR}/AppIcon86x86@2x.png
sips $1 -Z 196 -o ${GENERATED_DIR}/AppIcon98x98@2x.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment