Menu Content/Inhalt
Home arrow Blog arrow Creating favicon.ico icon files with imagemagick convert.
Creating favicon.ico icon files with imagemagick convert. PDF Print E-mail
Written by Daniel A. Bergamini   
Wednesday, 25 November 2009

I have struggled with this in the past, but have only just found the solution. Every time I created a .ico it wouldn't display properly as a favicon.ico. I also only recently figured out that .ico files support multiple sizes simultaneously. Here is how I was able to accomplish both. First you'll want to create a square image of a size of, or larger than the largest size you want to include in your icon. I prefer transparent images, when possible:

convert some_image.bmp -resize 256x256 -transparent white favicon-256.png

Then we'll want to make images for each size you want to include in the .ico file.

convert favicon-256.png -resize 16x16 favicon-16.png
convert favicon-256.png -resize 32x32 favicon-32.png
convert favicon-256.png -resize 64x64 favicon-64.png
convert favicon-256.png -resize 128x128 favicon-128.png

 Now you'll want to bundle them up into the .ico file, the trick I found is to make it 256 colors or it will not display properly!

convert favicon-16.png favicon-32.png favicon-64.png favicon-128.png favicon-256.png -colors 256 favicon.ico

There you have it, open it up in gimp and make sure it looks OK. Each image should appear as a layer.

Last Updated ( Thursday, 26 November 2009 )