Mac OS X programming FAQ: How can I create a Mac ICNS file for my Mac application?
Lately I've been creating a series of small Mac applications, and as part of that I needed to learn how to make Mac ICNS files from standard image files (PNG, JPG, other). Today I offer a quick tip of my hat to the makers of a Mac application named FastIcns that lets you do just this.
FastIcns is a small, free application from a company named Digital Waters that lets you create a Mac ICNS file from a PNG, JPEG, or other image file very easily. Here's how to do it.
To create a Mac ICNS file from a PNG or JPEG image file using FastIcns, just follow these steps:
Once you have a properly created ICNS file like this, you can place it in your Mac OS X application bundle, and the ICNS images should show up properly in all the usual places -- your application icon, the Dock, and anywhere else you might see your application, such as in the Finder.
For the record, here's the FastIcns file-save dialog:

For today I'm going to run with the assumption that you won't be reading this article unless you know what an ICNS file is, so I'm skipping all that introductory information. For more Mac ICNS file format information, see this Mac Icons Wikipedia page.
To download the FastIcns application, follow this link:
Again, many thanks to the people at Digital Waters for making FastIcns available as a free Mac ICNS file creator.
How?
My folder shows the icns. Preview icon... not the image i have chosen. What have I done wrong?
Can you give me a little more
Can you give me a little more information? If you double-click the ICNS file, it should open up in Preview. If so, does it look right there?
Detail
Yes, when I open the file in Preview, it is 9 different size files. I used a png picture, want to make a School folder, with the student hat :)
It works grest with another incs file I found on http://destegabry.deviantart.com/art/NetBeans-Leopard-folder-icon-83461058. No white background, but mine is just a incs preview icon..
ICNS file thumbnail/preview image
Is the problem that the icon in Finder just looks like the default preview icon? If so, I don't know the proper solution to this, but I've found that by renaming a file, it usually turns from the default icon to an icon of your actual image, or in this case, your ICNS file.
So, if your file is named something like a.icns, rename it to b.icns, and see if that does the trick. Then you can rename it back to a.icns. I've also seen moving a file to a different directory will also cause the preview thumbnail to be generated/used.
I'm sorry I don't know enough about how this part of Mac OS X works, but if someone else knows the answer, I certainly welcome it. It's like OS X didn't get an initial event to generate the thumbnail, so you have to create a new event to tell it to generate a thumbnail.
I hope I answered the question, lol.
Post new comment