Skip to content

Instantly share code, notes, and snippets.

@mgrider
Forked from alvinthen/prepare_icons.sh
Last active June 27, 2023 22:02
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mgrider/3c25a49accf46f8953e7d4dc49fca2c1 to your computer and use it in GitHub Desktop.
Save mgrider/3c25a49accf46f8953e7d4dc49fca2c1 to your computer and use it in GitHub Desktop.
Make all app icons with imagemagick, iOS and Android
#!/bin/sh
base=$1
if [ -z $base ]
then
echo No argument given
else
##
## iOS files
convert "$base" -resize 20x20! "Icon-20.png"
convert "$base" -resize 29x29! "Icon-Small.png"
convert "$base" -resize 40x40! "Icon-Small-40.png"
convert "$base" -resize 50x50! "Icon-Small-50.png"
convert "$base" -resize 57x57! "Icon.png"
convert "$base" -resize 58x58! "Icon-Small@2x.png"
convert "$base" -resize 87x87! "Icon-Small@3x.png"
convert "$base" -resize 60x60! "Icon-60.png"
convert "$base" -resize 72x72! "Icon-72.png"
convert "$base" -resize 76x76! "Icon-76.png"
convert "$base" -resize 80x80! "Icon-Small-40@2x.png"
convert "$base" -resize 100x100! "Icon-Small-50@2x.png"
convert "$base" -resize 114x114! "Icon@2x.png"
convert "$base" -resize 120x120! "Icon-60@2x.png"
convert "$base" -resize 144x144! "Icon-72@2x.png"
convert "$base" -resize 152x152! "Icon-76@2x.png"
convert "$base" -resize 167x167! "Icon-83.5@2x.png"
convert "$base" -resize 180x180! "Icon-60@3x.png"
convert "$base" -resize 512x512! "iTunesArtwork"
convert "$base" -resize 1024x1024! "iTunesArtwork@2x"
##
## Apple Watch
## Guidelines: https://developer.apple.com/design/human-interface-guidelines/watchos/icons-and-images/home-screen-icons/
convert "$base" -resize 48x48! "Icon-Watch-38mm@2x.png"
convert "$base" -resize 55x55! "Icon-Watch-40mm@2x.png"
convert "$base" -resize 80x80! "Icon-WatchHome-40@2x.png"
convert "$base" -resize 88x88! "Icon-WatchHome-44@2x.png"
convert "$base" -resize 100x100! "Icon-WatchHome-50@2x.png"
convert "$base" -resize 48x48! "Icon-WatchNotification-24@2x.png"
convert "$base" -resize 55x55! "Icon-WatchNotification-27.5@2x.png"
convert "$base" -resize 58x58! "Icon-WatchNotification-29@2x.png"
convert "$base" -resize 172x172! "Icon-WatchShortNotification-86@2x.png"
convert "$base" -resize 196x196! "Icon-WatchShortNotification-98@2x.png"
convert "$base" -resize 216x216! "Icon-WatchShortNotification-108@2x.png"
convert "$base" -resize 58x58! "Icon-WatchCompanion-29@2x.png"
convert "$base" -resize 87x87! "Icon-WatchCompanion-29@3x.png"
##
## Android files
convert "$base" -resize 36x36! "Icon-ldpi.png"
convert "$base" -resize 48x48! "Icon-mdpi.png"
convert "$base" -resize 72x72! "Icon-hdpi.png"
convert "$base" -resize 96x96! "Icon-xhdpi.png"
convert "$base" -resize 144x144! "Icon-xxhdpi.png"
convert "$base" -resize 192x192! "Icon-xxxhdpi.png"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment