How can I convert a .png file to .icns

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.


Solution 1:

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

Solution 2:

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/