How do I convert a .PNG into a .ICO?
For one-off tasks I usually just cheat: ConvertICO.com .
If you will be doing this fairly often, you may want to consider the free Photoshop plugin.
The opensource imagemagick convert
utility can pack multiple images into one single icon file. It provides image re-sizing to generate multiple size icons, and support various other image manipulation. Imagemagick contains several image handling utilities, is opensource, free to use, available on multiple platforms (Linux, Windows, Mac Os X, iOS) and can be batched easily for example in Continuous Integration pipelines.
Here is a basic example exporting a svg
file (the vector svg
format is a good choice to generate consistent images of multiple size, like icons) to a png
file in a temporary folder:
convert icon.svg -scale 32 tmp/32.png
To pack several several of such png
files in a final ico
file, use:
convert tmp/16.png tmp/32.png tmp/48.png tmp/128.png tmp/256.png icon.ico
Note that the standalone convert
binary is no longer installed by default. On Windows, you must check the (quite explicit) Install legacy utilities (e.g. convert) option. In case you missed it, simply use the slightly longer magick convert
command rather than the standalone convert
command.
Install ffmpeg from: Windows: http://ffmpeg.zeranoe.com/builds/ OSX: http://ffmpegmac.net/
From the shell, use the following command to convert PNG to ICO.
ffmpeg -i img.png img.ico
Also if you use ffmpeg regularly, don't forget to add it your PATH variable.
There's also the Paint.NET ICO plugin (plugin now updated for v4.0+).
Download IcoCur.Zip. Unzip the dll and put it in the "FileTypes" folder in the Paint.NET directory.
It will load and save .ico, .cur and .ani files (.ani as of July 29, 2006).
When loading from an icon or cursor file that contains multiple images, you are given a prompt and allowed to choose which image to load. It always bugged me when there would be 3 or so images in an icon file and other image editors would just auto-load the low resoultion 8x8 one or something like that, so I added the feature to choose.