19

What is the correct way of converting one or more .png files to .icns files?.

I've installed icnsutils but I'm having a hard time figuring out how to work with png2icns.

2 Answers 2

18

You can use:

 png2icns file.icns file.png

The first one is the name you want your .icns file to have. The last one is the .png file you want to export as an icon.

Important: Only convert the icons that match sizes icns supports: (16x16, 32x32, 128x128, 256x256, 512x512 and 1024x1024 pixels)

Or you can use an online service: iConvert Icons

Source: Ubuntu manuals

7
  • 1
    It complains about the size Bad dimensions. I just tried iConvert works fine however,I have to manually select the images one by one, I have to convert over 600 pngs :) . Nov 28, 2012 at 23:43
  • 1
    Which are the dimensions you are trying to use? Apparently that error is thrown when the size is not supported. The png2icns documentation says: /* Only convert the icons that match sizes icns supports */ which as far as I know are: 16x16, 32x32, 128x128, 256x256, 512x512 and 1024x1024 pixels
    – M. Cunille
    Nov 29, 2012 at 1:12
  • Hmm they're 640x640 but I can resize them to 512 and try again, is there a way to batch convert them? Nov 29, 2012 at 4:00
  • You can try using this software: RedImages
    – M. Cunille
    Nov 29, 2012 at 4:07
  • Sorry, I mean batch convert the .png files to .icns Nov 29, 2012 at 4:08
1

Since converting a PNG image into an ICNS file is very time consuming, I developed my own CLI to do it automatically and quickly. You can install the package using the node package manager (npm).

Link: https://www.npmjs.com/package/make-icns.

You just need to give it a PNG and it will do all the rest for you:

$ mk-icns /path/to/pngFile.png /destination/directory

Please follow the documentation for more details

Here is a link to the node official website if you do not know what npm or node is: https://nodejs.org/en/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .