read the head of this web page and snarf at will. Just saving the file as /favicon.ico will show up in some web browsers, but you need the meta tag line to make it work in most (eg. mozilla).
More info on making and installing favicon.ico files on unix can be found at http://www.mavetju.org/unix/favicon.php.
Whereas they suggested saving to pnm and converting to with ppmtowinicon from netpbm, I just saved as BMP from the gimp and renamed the file to .ico; AFAIK .ico is just .bmp format and 'file' shows pretty much the same thing (Win 3.1 not OS/2 format or some shit).
Mind you I took it down to 32 colours, most sites recommend 16 but that looks a bit shittier, more would be nice, I don't know the tradeoffs. I figure most people can handle a decent amount of colours thesedays, it ain't 1996, if it was we'd be sitting in level 3 of the comp sci building hung over as fuck and playing with java demos, listening to robert miles through the speakers on a sparcstation 20.