-
-
Save monkeywithacupcake/d2bd4192269db6b742832a81010f22e9 to your computer and use it in GitHub Desktop.
Icon sizes generator for iOS/watchOS/iMessage apps.
This file contains 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 | |
# Sizes from https://developer.apple.com/library/ios/#qa/qa1686/_index.html | |
# Requirements: ImageMagick | |
function resize { | |
GREEN='\033[0;32m' | |
BLUE='\033[0;34m' | |
DEFAULT='\033[0m' | |
echo -e "Generating ${BLUE}$3${DEFAULT} at size ${GREEN}$2 ${DEFAULT}" | |
convert $1 -resize $2 $3 | |
} | |
if [ $1 = '-h' ]; then | |
echo "As first param use one of [iphone/ipad/ios/watchos/imessage]" | |
echo "keyword, the second param is path to the large image" | |
echo "" | |
echo "bash icons-generator iphone 1024.png" | |
echo "bash icons-generator ios 1024.png" | |
fi | |
# Icons for iPhone-only Applications | |
if [ $1 = 'iphone' ]; then | |
resize $2 1024x1024 AppIcon-1024.png # App list in iTunes for devices with retina display | |
resize $2 120x120 AppIcon-60@2x.png # Home screen on iPhone/iPod Touch with retina display | |
resize $2 180x180 AppIcon-60@3x.png # Home screen on iPhone with retina HD display | |
resize $2 40x40 AppIcon-40.png # Spotlight | |
resize $2 80x80 AppIcon-40@2x.png # Spotlight on devices with retina display | |
resize $2 120x120 AppIcon-40@3x.png # Spotlight on devices with retina HD display | |
resize $2 29x29 AppIcon-29.png # Settings | |
resize $2 58x58 AppIcon-29@2x.png # Settings on devices with retina display | |
resize $2 87x87 AppIcon-29@3x.png # Settings on devices with retina HD display | |
resize $2 57X57 AppIcon-57.png # Home screen on iPhone iOS 5,6 | |
resize $2 114X114 AppIcon-57@2x.png # Home screen on iPhone with retina display iOS 5,6 | |
# Apple does not list these sizes | |
resize $2 20x20 AppIcon-20.png # notification iOS 7-11 | |
resize $2 40x40 AppIcon-20@2x.png # iPhone/iPad notification iOS 7-11 on devices with retina display | |
resize $2 60x60 AppIcon-20@3x.png # iPhone notification iOS 7-11 on devices with retina HD display | |
fi | |
# Icons for iPad-only Applications | |
if [ $1 = 'ipad' ]; then | |
resize $2 1024x1024 AppIcon-1024.png # App list in iTunes for devices with retina display | |
resize $2 180x180 AppIcon-60@3x.png # Home screen on iPhone with retina HD display | |
resize $2 72x72 AppIcon-72.png # Home screen on iPad iOS 5,6 | |
resize $2 144X144 AppIcon-72@2x.png # Home screen on iPad with retina display iOS 5,6 | |
resize $2 76x76 AppIcon-76.png # Home screen on iPad | |
resize $2 152x152 AppIcon-76@2x.png # Home screen on iPad with retina display | |
resize $2 167x167 AppIcon-83.5@2x.png # Home screen on iPad Pro | |
resize $2 40x40 AppIcon-40.png # Spotlight | |
resize $2 80x80 AppIcon-40@2x.png # Spotlight on devices with retina display | |
resize $2 120x120 AppIcon-40@3x.png # Spotlight on devices with retina HD display | |
resize $2 29x29 AppIcon-29.png # Settings | |
resize $2 58x58 AppIcon-29@2x.png # Settings on devices with retina display | |
resize $2 87x87 AppIcon-29@3x.png # Settings on devices with retina HD display | |
resize $2 50X50 AppIcon-50.png # iPad Spotlight iOS 5,6 | |
resize $2 100x100 AppIcon-50@2x.png # iPad Spotlight iOS 5,6 | |
# Apple does not list these sizes | |
resize $2 20x20 AppIcon-20.png # iPad notification iOS 7-11 | |
resize $2 40x40 AppIcon-20@2x.png # iPhone/iPad notification iOS 7-11 on devices with retina display | |
fi | |
# Icons for Universal Applications | |
if [ $1 = 'ios' ]; then | |
resize $2 1024x1024 AppIcon-1024.png # App list in iTunes for devices with retina display | |
resize $2 120x120 AppIcon-60@2x.png # Home screen on iPhone/iPod Touch with retina display | |
resize $2 180x180 AppIcon-60@3x.png # Home screen on iPhone with retina HD display | |
resize $2 72x72 AppIcon-72.png # Home screen on iPad iOS 5,6 | |
resize $2 144X144 AppIcon-72@2x.png # Home screen on iPad with retina display iOS 5,6 | |
resize $2 76x76 AppIcon-76.png # Home screen on iPad | |
resize $2 152x152 AppIcon-76@2x.png # Home screen on iPad with retina display | |
resize $2 167x167 AppIcon-83.5@2x.png # Home screen on iPad Pro | |
resize $2 40x40 AppIcon-40.png # Spotlight | |
resize $2 80x80 AppIcon-40@2x.png # Spotlight on devices with retina display | |
resize $2 120x120 AppIcon-40@3x.png # Spotlight on devices with retina HD display | |
resize $2 29x29 AppIcon-29.png # Settings | |
resize $2 58x58 AppIcon-29@2x.png # Settings on devices with retina display | |
resize $2 87x87 AppIcon-29@3x.png # Settings on devices with retina HD display | |
resize $2 50X50 AppIcon-50.png # iPad Spotlight iOS 5,6 | |
resize $2 100x100 AppIcon-50@2x.png # iPad Spotlight iOS 5,6 | |
resize $2 57X57 AppIcon-57.png # Home screen on iPhone iOS 5,6 | |
resize $2 114X114 AppIcon-57@2x.png # Home screen on iPhone with retina display iOS 5,6 | |
# Apple does not list these sizes | |
resize $2 20x20 AppIcon-20.png # iPad notification iOS 7-11 | |
resize $2 40x40 AppIcon-20@2x.png # iPhone/iPad notification iOS 7-11 on devices with retina display | |
resize $2 60x60 AppIcon-20@3x.png # iPhone notification iOS 7-11 on devices with retina HD display | |
fi | |
# Icons for Watch Applications | |
if [ $1 = 'watchos' ]; then | |
resize $2 80x80 AppIcon40x40@2x.png # Home screen on Apple Watch (38mm/42mm), Long-Look notification on Apple Watch (38mm) | |
resize $2 88x88 AppIcon44x44@2x.png # Long-Look notification on Apple Watch (42mm) | |
resize $2 172x172 AppIcon86x86@2x.png # Short-Look notification on Apple Watch (38mm) | |
resize $2 196x196 AppIcon98x98@2x.png # Short-Look notification on Apple Watch (42mm) | |
resize $2 48x48 AppIcon24x24@2x.png # Notification center on Apple Watch (38mm) | |
resize $2 55x55 AppIcon27.5x27.5@2x.png # Notification center on Apple Watch (42mm) | |
resize $2 58x58 AppIcon29x29@2x.png # Settings in the Apple Watch companion app on iPhone | |
resize $2 87x87 AppIcon29x29@3x.png # Settings in the Apple Watch companion app on iPhone 6 Plus | |
fi | |
# Icons for iMessage Extensions | |
if [ $1 = 'imessage' ]; then | |
resize $2 1024x768 Messages1024x768.png # Messages App Store | |
resize $2 120x90 Messages60x45@2x.png # Messages app drawer on iPhone/iPod Touch with retina display | |
resize $2 180x135 Messages60x45@3x.png # Messages app drawer on iPhone with retina HD display | |
resize $2 134x100 Messages67x50@2x.png # Messages app drawer on iPad with retina display | |
resize $2 148x110 Messages74x55@2x.png # Messages app drawer on iPad Pro | |
resize $2 54x40 Messages27x20@2x.png # Breadcrumb icons in the chat transcript on devices with retina display. | |
resize $2 81x60 Messages27x20@3x.png # Breadcrumb icons in the chat transcript on iPhone with retina HD display | |
resize $2 64x48 Messages32x24@2x.png # Messages app management screen, message bubble branding on devices with retina display | |
resize $2 96x72 Messages32x24@3x.png # Messages app management screen, message bubble branding on iPhone with retina HD display | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment