Skip to content

Instantly share code, notes, and snippets.

@samisalkosuo
Created December 14, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samisalkosuo/f24b40cf2e3e818a452d to your computer and use it in GitHub Desktop.
Save samisalkosuo/f24b40cf2e3e818a452d to your computer and use it in GitHub Desktop.
Create iOS icons from source image.
#!/usr/bin/env bash
#uses clpargs
#https://github.com/samisalkosuo/clpargs
source $GITDIR/clpargs/clpargs.bash
clpargs_program_description "Create iOS app icons from original 1024x1024 icon."
#iOS icon sizes
#https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
clpargs_define IMAGE "FILENAME" "Image file. ASSUMPTION: given image is 1024x1024" true
clpargs_parse "$@"
resize()
{
filename=$(basename "$1")
filename="${filename%.*}"
TARGET=$filename"_$2.png"
convert $1 -resize $2 $TARGET
}
cp $IMAGE iTunesArtwork
resize $IMAGE 180x180
resize $IMAGE 120x120
resize $IMAGE 152x152
resize $IMAGE 76x76
resize $IMAGE 40x40
resize $IMAGE 100x100
resize $IMAGE 167x167
resize $IMAGE 80x80
resize $IMAGE 60x60
resize $IMAGE 72x72
resize $IMAGE 144x144
resize $IMAGE 87x87
resize $IMAGE 57x57
resize $IMAGE 114x114
resize $IMAGE 58x58
resize $IMAGE 29x29
resize $IMAGE 60x60
resize $IMAGE 66x66
resize $IMAGE 44x44
resize $IMAGE 22x22
resize $IMAGE 75x75
resize $IMAGE 50x50
resize $IMAGE 25x25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment