The ICO (.ico) icon format is a Windows icon format and as a web developer, I only see it used in the favicon.ico file. So when I was asked to export a logo in the ICO format for use in a desktop application, I had to do some homework. Since I couldn’t find it within a few minutes, here’s my contribution for anyone looking for a quick solution.

The solution

  1. Make sure you export the icon at a resolution of 250x250px.
  2. We’re going to use Imagemagick for the conversion. Make sure to install it (for Mac/Homebrew users: brew install imagemagick).
  3. Run this command: convert -density 384 icon.svg -define icon:auto-resize icon.ico and change icon.svg and icon.ico to the desired filenames.

The ICO format is an odd beast, it stores multiple images with different sizes in the same file. To check if everyting was converted correctly, run:

identify icon.ico

This should output something similar to this:

icon.ico[0] ICO 256x256 256x256+0+0 8-bit sRGB 0.010u 0:00.006
icon.ico[1] ICO 192x192 192x192+0+0 8-bit sRGB 0.000u 0:00.004
icon.ico[2] ICO 128x128 128x128+0+0 8-bit sRGB 0.000u 0:00.002
icon.ico[3] ICO 96x96 96x96+0+0 8-bit sRGB 0.000u 0:00.002
icon.ico[4] ICO 64x64 64x64+0+0 8-bit sRGB 0.000u 0:00.001
icon.ico[5] ICO 48x48 48x48+0+0 8-bit sRGB 0.000u 0:00.001
icon.ico[6] ICO 40x40 40x40+0+0 8-bit sRGB 0.000u 0:00.001
icon.ico[7] ICO 32x32 32x32+0+0 8-bit sRGB 0.000u 0:00.001
icon.ico[8] ICO 24x24 24x24+0+0 8-bit sRGB 0.000u 0:00.001
icon.ico[9] ICO 16x16 16x16+0+0 8-bit sRGB 569494B 0.000u 0:00.001

This should give you a high quality desktop icon.


Sources