Easy Way To Create Favicon

News flash! Benny Chandra [discovers favicons](http://bennychandra.com/2004/10/06/pasang-favicon/) :). He used an [online service](http://www.chami.com/html-kit/services/favicon/) to create his own favicon.ico. Here is [Wikipedia](http://en.wikipedia.org) entry for [favicon](http://en.wikipedia.org/wiki/Favicon).

Favicon.ico itself is a 16×16 bitmap stored in legacy Microsoft icon resource file. Actually, it is very easy to generate favicon.ico from an existing image file using [ImageMagick](http://www.imagemagick.org/). 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. Root access or physical access to the box is not required. Regular user privilege suffices. No need to use fancy graphical editor like [Adobe Photoshop](http://www.adobe.com/products/photoshop/main.html) or [The Gimp](http://www.gimp.org).

Suppose you have an image named picture.png. To convert it into favicon.ico all you need to do is to execute the following command:

convert picture.png -resize 16×16! favicon.ico

That’s it. No fuss, no muss. Any experienced PHP/Perl/Python coder can use the above oneliner to easily create their own aforementioned web based favicon.ico generator.


  1. I always create favicon in Linux using Gimp by saving as xpm format; then converting it into ico using xpm2wico utility. Either Gimp or xmp2wico are available in Debian package, so apt-get will be enough. Because my favicon is deadly simple, I am not sure this method is sufficient for everyone.

  2. If ImageMagick is not available but Netpbm is, then you can also use something like this:

    pngtopnm favicon.png > favicon.ppm
    pngtopnm -alpha favicon.png > favicon.pgm
    ppmtowinicon -andpgms -output favicon.ico favicon.ppm favicon.pgm
    rm favicon.ppm favicon.pgm

Leave a comment

Your email address will not be published. Required fields are marked *