Corona SDK Pro Tip of the Day #6
App icons

Use ImageMagick script to make all app icons.

It is always frustrating to make all app icon sizes one by one by hand in Photoshop or other similar software.

So I made a little script with a twist. You can grab it here.

ImageMagick

You need ImageMagick installed. For this download and install MacPorts first. Here is a direct link for OS X 10.9 installer.

Once you install ImageMagick, open console and type

sudo port -v selfupdate  

That will download fresh package list. At this point you can install ImageMagick by typing

sudo port install imagemagick  

This might take some time, but be patient.

prepare_icons.sh

Once ImageMagick is installed you can use the script. Move it for example to /usr/bin so it will be accessible from any directory in the console.

Also set it's execution permission with

sudo chmod +x /usr/bin/prepare_icons.sh  

How to use

Copy your big app icon, say Icon1024.png (don't use Icon.png name or any other names that get created or the results will be terrible), inside your project directory. Then open this directory in the console (for this I usually type cd in iTerm2 and drag the directory into the console).

Once you are there, type in the console

prepare_icons.sh Icon1024.png  

That will make all neccessary app icons in the directory.

build.settings

You also have to specify icon names inside CFBundleIconFiles like this

settings = {  
    iphone = {
        plist = {
            CFBundleIconFiles = {
                'Icon.png',
                'Icon@2x.png',
                'Icon-Small-40.png',
                'Icon-Small-40@2x.png',
                'Icon-60.png',
                'Icon-60@2x.png',
                'Icon-60@3x.png',
                'Icon-72.png',
                'Icon-72@2x.png',
                'Icon-76.png',
                'Icon-76@2x.png',
                'Icon-Small-50.png',
                'Icon-Small-50@2x.png',
                'Icon-Small.png',
                'Icon-Small@2x.png'
            }
        }
    }
}

The twist

The script uses not a simple resize, but a resize with a following sharpening. This way your icons will look much better after resizing. It's similar to Photoshop's "bicubic sharper."

Indie Game Developer