[Update 2019-10-23: I am no longer using this; I have switched to a bash script solution.]
For iOS development, it is necessary to provide a set of app icons of different sizes, all the way from a high-resolution icon for the AppStore to a tiny icon that will be used in Spotlight search results. The trouble is, how to create the icons, again, and again,...
Well, here's how...
Starting off with a 1024 x 1024 pixels source image (in PNG format), one would have to scale it multiple times in an image editing tool, to export it into all the sizes. But can't this be automated with AppleScript?
Well, yes, but it gets better: Use Automator !
I have set up this Automator workflow to create all icon images. It works like this:
- Launch the workflow in Automator and Run it.
- You will be prompted to select the 1024x1024 PNG source image.
- You will be prompted to select a destination folder.
When the workflow is finished, you will find these files in the output folder:
- iTunesArtwork@2x (1024x1024)
- iTunesArtwork (512x512)
- Icon-1024.png (1024x1024)
- Icon-512.png (512x512)
- Iconfirstname.lastname@example.org (180x180)
- Iconemail@example.com (152x152)
- Iconfirstname.lastname@example.org (144x144)
- Iconemail@example.com (120x120)
- Icon@2x.png (114x114)
- Icon-Smallfirstname.lastname@example.org (100x100)
- Iconemail@example.com (80x80)
- Icon-Small@2x.png (58x58)
- Icon-76.png (76x76)
- Icon-72.png (72x72)
- Icon-60.png (60x60)
- Icon.png (57x57)
- Icon-Small-50.png (50x50)
- Icon-40.png (40x40)
- Icon-Small.png (29x29)
But wait, there's more!
Are you missing an icon size? Just edit the workflow to fit your needs.