Covert ICNS to image file formats using sips

Jan 03, '06 05:35:00AM

Contributed by: ChaChi

I was recently involved in a thread on the Apple discussion forums that involved converting ICNS files to various image file formats. I had been using the unix sips command to accomplish this task for quite a while in my own scripts. I never thought to mention it as an undocumented feature, until the original poster of the thread mentioned it might be something others would find useful.

Use the following command to convert (as an example) an ICNS file to a png image file:

sips -s format png /Path/To/Icon.icns --out /Path/To/ConvertedImage.png
The command above would convert an ICNS file named Icon.icns to a png file named ConvertedImage.png. To convert to other image file formats, simply replace the portion of the command that reads png with the file format of your liking. You can choose from these possible formats: jpeg, tiff, png, gif, jp2, pict, bmp, qtif, psd, sgi, and tga.

As I mentioned in the thread at Apple's site, you can type man sips, sips -h or sips -H to access the sips manual and help pages, but there isn't any mention of its ability to work with the ICNS file format. The only formats listed are those shown above. Hope this helps someone else out as much as it has I and the poster of the original question at Apple's site...

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20051225191249727