December 30, 2003

Newbie Mac tip: Changing icons for files and applications is delightfully easy. If you see a file or application with an icon you want to use with another one, select the first, go to the File menu and select Get Info (command-i), click on the icon then go to the Edit menu and select Copy (command-c). Select the file/application whose icon you want to change, click on the icon, then go to the Edit menu and select Paste (command-v).

In fact, copying any image data to the clipboard will let you paste it as an item's icon. See an image on the web you like for an icon? In Safari, control-click (or right-click) on the image you want and select Copy Image to Clipboard. Get Info on the item, click the icon, and Paste. You can even copy image data directly to the clipboard from an image editor, and paste it into an item's icon. Don't like what you pasted? Go to the Edit menu, select Undo (command-z). To revert a file's icon to its default state at any time, Get Info, then go to the Edit menu and Cut (control-x).

It appears small icon images are never stretched, so if you paste in a small image, the icon stays small, possibly smaller than you expect in certain conditions. The optimal image size for OS X icons is 128 x 128, so use your favorite image editor to stretch to fit. Images larger than that size are shrunk proportionately so the largest dimension is 128 pixels.

Most common image formats are supported— however, GIF and PNG transparency don't appear to work, so you'll get a solid color background for those. Actual application and system icons are stored in .icns files, which contain up to four sizes of images (128x128 being the largest), and also include bitmasks to define transparency and clickable area. The Icon Composer that comes with the Developer Tools (/Developer/Applications/Utilities/Icon Composer) can quickly and easily make .icns files and generate bitmasks from images of various types. Unfortunately, .icns files cannot simply be associated with arbitrary items; they can only replace system defaults and be associated with packaged applications (Mac OS X apps that are actually directories with bundled resources). As such, I have to conclude that there is no way to support icons with transparent images associated with arbitrary items, like shell scripts (.command files, .term files) or folders. Someone correct me if I'm wrong.

Xicons is dedicated to freeware icons for OS X, and has a few nice tutorials. The Gnome Linux Desktop project has some excellent art, though all of it is in PNG format and needs to be converted using an icon editor to work well with OS X.

Iconographer is a popular shareware ($15) icon editing application. Xicons has an icon design tutorial that describes how to achieve certain effects common to Aqua icons (glare, shadows). Apple Developer Connection's Icons guide includes links to Apple's Human Interface Guidelines, links to icon design tools, and other information.

And finally, Xicons has a tutorial on changing the system icons by replacing .icns and .png files.

comments...

http://www.iconfactory.com/



May answer your transparency questions.



I think you may be able to use the dev tools icon doohickey to edit an arbitrarily assigned icon such that you can use the masking - that's the ols-OS expected behgavior, but god knows I haven't looked into it.