Hi -
I extended the prepare_icons.sh shell script from the Corona Cannon sample project to make it generate launch images as well as icons. It works from two base images:
-
icon1024-iOS.png (1024x1024 rectangular image)
-
icon-iOS.png (1024x1024 rounded corner image)
This uses GraphicsMagick but I imagine would work with ImageMagick too.
Posting it here in case it’s useful to anyone else. If there’s a better place to submit this, please let me know!
With thanks to Vlad for the original script.
Tom
#!/bin/sh # path to convert binary gmpath="/usr/local/bin/gm" # bgcolor for blank canvas (can be "transparent") bgcolor="#2E2864" # iOS icons base="icon1024-iOS.png" "$gmpath" convert "$base" -resize '29x29' -unsharp 1x4 "Icon-Small.png" "$gmpath" convert "$base" -resize '40x40' -unsharp 1x4 "Icon-Small-40.png" "$gmpath" convert "$base" -resize '50x50' -unsharp 1x4 "Icon-Small-50.png" "$gmpath" convert "$base" -resize '57x57' -unsharp 1x4 "Icon.png" "$gmpath" convert "$base" -resize '58x58' -unsharp 1x4 "Icon-Small@2x.png" "$gmpath" convert "$base" -resize '60x60' -unsharp 1x4 "Icon-60.png" "$gmpath" convert "$base" -resize '72x72' -unsharp 1x4 "Icon-72.png" "$gmpath" convert "$base" -resize '76x76' -unsharp 1x4 "Icon-76.png" "$gmpath" convert "$base" -resize '80x80' -unsharp 1x4 "Icon-Small-40@2x.png" "$gmpath" convert "$base" -resize '100x100' -unsharp 1x4 "Icon-Small-50@2x.png" "$gmpath" convert "$base" -resize '114x114' -unsharp 1x4 "Icon@2x.png" "$gmpath" convert "$base" -resize '120x120' -unsharp 1x4 "Icon-60@2x.png" "$gmpath" convert "$base" -resize '144x144' -unsharp 1x4 "Icon-72@2x.png" "$gmpath" convert "$base" -resize '152x152' -unsharp 1x4 "Icon-76@2x.png" "$gmpath" convert "$base" -resize '180x180' -unsharp 1x4 "Icon-60@3x.png" "$gmpath" convert "$base" -resize '512x512' -unsharp 1x4 "iTunesArtwork" "$gmpath" convert "$base" -resize '1024x1024' -unsharp 1x4 "iTunesArtwork@2x" # iOS launch images "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 640x960 "Default@2x.png" # portrait iPhone 4 / 4s "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 640x1136 "Default-568h@2x.png" # portrait iPhone 5 / 5s "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 1136x640 "Default-Landscape-568h@2x.png" # landscape iPhone 5 / 5s "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 750x1334 "Default-667h@2x.png" # portrait iPhone 6 / 6s / 7 "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 1334x750 "Default-Landscape-667h@2x.png" # landscape iPhone 6 / 6s / 7 "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 1242x2208 "Default-736h@3x.png" # portrait iPhone 6 Plus / 6s Plus / 7 Plus "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 2208x1242 "Default-Landscape-736h@3x.png" # landscape iPhone 6 Plus / 6s Plus / 7 Plus "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 768x1024 "Default-Portrait.png" # portrait iPad 2 / 3, iPad Mini 1 "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 1024x768 "Default-Landscape.png" # landscape iPad 2 / 3, iPad Mini 1 "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 1536x2048 "Default-Portrait@2x.png" # portrait iPad 4, iPad Air, iPad Mini 2 / 3 / 4, iPad Pro 9.7" "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 2048x1536 "Default-Landscape@2x.png" # landscape iPad 4, iPad Air, iPad Mini 2 / 3 / 4, iPad Pro 9.7" "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 2048x2732 "Default-Portrait-1366@2x.png" # portrait iPad Pro 12" "$gmpath" convert "$base" -resize '640x640' -gravity center -background $bgcolor -extent 2732x2048 "Default-Landscape-1366@2x.png" # landscape iPad Pro 12" # Android images "$gmpath" convert "$base" -resize '320x320' -gravity center -background $bgcolor -extent 320x180 "Banner-xhdpi.png" # Android TV "$gmpath" convert "$base" -resize '320x320' -gravity center -background $bgcolor -extent 732x412 "Icon-ouya.png" # Ouya "$gmpath" convert "$base" -resize '160x160' -gravity center -background $bgcolor -extent 284x160 "Icon-ouya-xiaomi.png" # Ouya Xiaomi app store # Android icons base="icon1024.png" "$gmpath" convert "$base" -resize '36x36' -unsharp 1x4 "Icon-ldpi.png" "$gmpath" convert "$base" -resize '48x48' -unsharp 1x4 "Icon-mdpi.png" "$gmpath" convert "$base" -resize '72x72' -unsharp 1x4 "Icon-hdpi.png" "$gmpath" convert "$base" -resize '96x96' -unsharp 1x4 "Icon-xhdpi.png" "$gmpath" convert "$base" -resize '144x144' -unsharp 1x4 "Icon-xxhdpi.png" "$gmpath" convert "$base" -resize '192x192' -unsharp 1x4 "Icon-xxxhdpi.png"