How to create a favicon for your site

Favicon is a 16×16 bitmap in Microsoft icon resource file format. There are a lot of tools available to create a favicon.ico. I used GIMP, which is available for any linux/unix system or can be downloaded from http://www.gimp.org and can be also used on windows. So, first step is to rescale your image to 16×16 pixels and save your rescaled image in pnm or ppm format. Using the command line utility ppmtowinicon which is part of Netpbm package you can obtain the favicon:

ppmtowinicon -output favicon.ico <inputfile.pnm | inputfile.ppm>

The other method is to use convert command which is part of ImageMagick package. Since almost all Linux distributions install ImageMagick by default, all you need to generate your own favicon.ico is a shell access to a Linux box:

convert file.jpg -resize 16×16! favicon.ico

All you need now is to copy favicon.ico in your web site root folder and add to your webpage next line, to the <head> section:

<link rel=”Shortcut Icon” href=”http://www.yourdomain.com/favicon.ico”>

That’s all.

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

I am using free tool at animatedfavicon.com. This one works great and its fast

Leave a comment

(required)

(required)