From MattWiki

You need an image file that GIMP can open (PNG, GIF, etc.). And you need the command line tool ppmtowinicon from the netpbm-tools (on SuSE you have to have installed the package netpbm). Now perform the following actions:

  1. Open your image with GIMP.
  2. If your image is not a square then resize the canvas with GIMP.
  3. Scale the image to 16x16 (or 24x24) pixel (Image, Scale image).
  4. Choose File, save as.. and save as favicon.pnm or favicon.ppm with raw encoding.
  5. Close GIMP
  6. Convert favicon.pnm resp. favicon.ppm using the command line utility ppmtowinicon:
ppmtowinicon -output favicon.ico favicon.pnm

That's all. Now copy your favicon.ico to the document root of your website.