Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Covert ICNS to image file formats using sips UNIX
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...
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[27,215 views]  

Covert ICNS to image file formats using sips | 5 comments | Create New Account
Click here to return to the 'Covert ICNS to image file formats using sips' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Covert ICNS to image file formats using sips
Authored by: gaoshan on Tue, Jan 3 2006 at 10:15AM PST

I was going to add this reply saying that you could also do this with Imagemagick (my favorite command line image manipulator) however, you can't!

So... you CAN'T use Imagemagick to do this. Good to know. I used to think of sips as a weak image manipulator that I had no use for. You've proven me wrong.

Thanks!



[ Reply to This | # ]
sips vs. imagemagick
Authored by: efc on Tue, Jan 3 2006 at 10:04PM PST
I've used both sips and imagemagick on a PowerMac G5. In addition to the undocumented feature mentioned in this hint, it is worth noting that in my work I've found sips to be at least 5 times faster than imagemagick. I don't know for sure, but my guess is that sips is using the Velocity engine in a way imagemagick (or at least the binary I had of it) does not.

True, imagemagick has more features than sips. But if sips can do the job and you have a lot of bulk work to get done, it can save a load of time.

[ Reply to This | # ]

Covert ICNS to image file formats using sips
Authored by: Pedro Estarque on Wed, Jan 4 2006 at 6:17AM PST
Way to go ChaChi !!!

And to gaoshan, yes I tried ImageMagick too, but it seems ICNS is a rather obscure format in the unix world.

efc - sips is highly optimized, it's a true hidden jewel in OS X. Not only is it much faster then IM, it's faster then anything I've ever seen. It does, however, lose for Adobe in terms of quality. If you want a true good looking JPEG, Adobe's algorithm will give you a better result albeit much slower.

[ Reply to This | # ]
Covert ICNS to image file formats using sips
Authored by: bailey_ca on Sun, Jan 15 2006 at 8:40PM PST

If you just want access to the icon(s) in the .icns file, try icns2icon. (See this hint.)



[ Reply to This | # ]
Covert ICNS to image file formats using sips
Authored by: ekologik on Sun, May 25 2008 at 7:04PM PDT
for me it didn't work if i put /Path i had to just put Path, without the slash. i'm running leopard. dunno if that makes a difference of if you just made a typo. but thanks for the tip, it works now that i figured out that small thing.

[ Reply to This | # ]