How can I convert a .png file to .icns
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/
Related videos on Youtube
Uri Herrera
Graphics designer. Manchester United fan since '97. Linux user. Nitrux founder.
Updated on September 18, 2022Comments
-
Uri Herrera over 1 year
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 withpng2icns
. -
Uri Herrera over 11 yearsIt 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 :) . -
M. Cunille over 11 yearsWhich 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
-
Uri Herrera over 11 yearsHmm they're 640x640 but I can resize them to 512 and try again, is there a way to batch convert them?
-
M. Cunille over 11 yearsYou can try using this software: RedImages
-
Uri Herrera over 11 yearsSorry, I mean batch convert the .png files to .icns
-
M. Cunille over 11 yearsSorry, not that I know.