favicon.ico : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

favicon.ico
Internet Explorer looks for a file called favicon.ico on your website to use to decorate any bookmarks it creates to your site. It is not a standard Internet gif, but a proprietary Windows icon file. The basic format is the 16x16x16 format normally used on Windows menus (16-color icon with width and height of 16 pixels) or a 32x32x16. You may optionally provide a different icon for each subdirectory. If you don’t provide such a file, you will find your website logs clogged with 404-file not found messages for favicon.ico.

For Internet use, you want something cross-platform, not MS proprietary, In HTML (Hypertext Markup Language), the icons are officially handled in another way, happily compatible with the original. You embed the following tag in your html in the <head> section before the <body>:

<link rel=icon href=image/myicon.gif>

or for compatibility with buggy browsers like MSIE (Microsoft Internet Explorer) :

<link rel=shortcut icon href=image/myicon.gif>

This way you can have a different icon on every page, and you can use standard *.gif, *.png or *.jpg files for your icon. At least in Opera, the size restrictions appear relaxed. I successfully used a 23 × 21 and a 24 × 16 image. Opera uses the on the personal bar to help you keep track of what site you are visiting.

Ideally it should be an *.ico file which can contain multiple images at multiple resolutions, and color depth. Resolutions are typically 16x16, 32 × 32 and 48x48, 64 × 64 and 128 × 128 and color depth is from 16 colors to True Color. IE (Internet Explorer) 5 can only handle 16x16.

Unfortunately ordinary image producing tools like PaintShop Pro can’t deal with *.ico format, so you need a specialised icon editor. A cheaper, though more clumsy way to create *.ico files is:

  1. Download a free copy of png2ico.exe. There are both Windows and Linux versions.
  2. Create or scavenge a *.png image, 128 × 128 usually with transparency.
  3. Save it in your temp directory as p128.png.
  4. Reduce the image to half size and save it as p64.png.
  5. Reduce by half again and save it as p32.png.
  6. Reduce by half again and save it as p16.png.
  7. At the command prompt type:
    png2ico firetruck.ico p16.png p32.png p64.png p128.png

This page is posted
on the web at:

http://mindprod.com/jgloss/faviconico.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\faviconico.html
logo
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.
no blog for this page
IP:[65.110.21.43]
Your face IP:[54.167.179.48]
You are visitor number