Skip to content

Instantly share code, notes, and snippets.

@lyamamot
Created August 9, 2017 16:29
Show Gist options
  • Save lyamamot/0f866c42a9230c1fb7c5dc4d77ec235c to your computer and use it in GitHub Desktop.
Save lyamamot/0f866c42a9230c1fb7c5dc4d77ec235c to your computer and use it in GitHub Desktop.
Generate placeholder icons for iOS apps that indicate their own size (in pixels).
#!/bin/bash
# https://developer.apple.com/library/content/qa/qa1686/_index.html
function create_image() {
COLOR=$1
TEXT_COLOR=$2
SIZE=$3
NAME=$4
convert -background "$COLOR" -fill white -font "Tahoma" -size $SIZEx$SIZE label:$SIZE "$NAME"
}
# Home screen on iPhone/iPod Touch with retina display
create_image '#ff0000' white 120 [email protected]
# Home screen on iPhone with retina HD display
create_image '#ff0000' white 180 [email protected]
# Home screen on iPad
create_image '#0000ff' white 76 Icon-76.png
# Home screen on iPad with retina display
create_image '#0000ff' white 152 [email protected]
# Home screen on iPad Pro
create_image '#0000ff' white 167 [email protected]
# Spotlight (should be Icon-Small-40.png)
create_image '#ff00ff' white 40 Icon-40.png
# Spotlight on devices with retina display (should be [email protected])
create_image '#ff00ff' white 80 [email protected]
# Spotlight on devices with retina HD display (should be [email protected])
create_image '#ff00ff' white 120 [email protected]
# Settings (should be Icon-Small.png)
create_image '#0000ff' white 29 Icon-29.png
# Settings on devices with retina display (should be [email protected])
create_image '#ff00ff' white 58 [email protected]
# Settings on devices with retina HD display (should be [email protected])
create_image '#ff0000' white 87 [email protected]
# iPhone Notification on devices with retina display
create_image '#ff0000' white 40 [email protected]
# Notification
create_image '#ff00ff' white 20 Icon-20.png
# Notification on devices with retina display
create_image '#ff00ff' white 40 [email protected]
# Notification on devices with retina HD display
create_image '#ff00ff' white 60 [email protected]
# Home screen on Apple Watch (38mm/42mm), Long-Look notification on Apple Watch (38mm) (should be [email protected])
create_image '#00ff00' black 80 [email protected]
# Long-Look notification on Apple Watch (42mm) (should be [email protected])
create_image '#00ff00' black 88 [email protected]
# Short-Look notification on Apple Watch (38mm) (should be [email protected])
create_image '#00ff00' black 172 [email protected]
# Short-Look notification on Apple Watch (42mm) (should be [email protected])
create_image '#00ff00' black 196 [email protected]
# Notification center on Apple Watch (38mm) (should be [email protected])
create_image '#00ff00' black 48 [email protected]
# Notification center on Apple Watch (42mm) (should be [email protected])
create_image '#00ff00' black 55 [email protected]
# Settings in the Apple Watch companion app on iPhone (should be [email protected])
create_image '#00ff00' black 58 [email protected]
# Settings in the Apple Watch companion app on iPhone 6 Plus (should be [email protected])
create_image '#00ff00' black 87 [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment