fav2png - Free favicon.ico to png image converter

Try a domain:
Result: fav2png

This is a really easy way to brighten up your link pages - by using the favicons of the pages you're linking to!

A site's favicon is typically displayed in your browser's address bar, and in your favourites or bookmarks. Their standard location is http://some.domain.com/favicon.ico. They have a standard size (16 x 16px) and are ideal for placing next to your links. We use fav2png throughout SectorPrime.

Most modern browsers display the .ico format (the normal format for favicons). So why use this script?

  • It converts the favicon to png format, for even greater browser compatibility.
  • If the site doesn't have a favicon, it servers up a default icon instead.
  • For faster performance, previously cached images can initially be downloaded by javascript while the latest image is created.
  • The script can be easily modified to change the size and age of the image cache.

The actual image manipulation is provided by Tony Cook's Imager.pm. You should be able to ask your web host to install e.g. www.bribes.org/perl/ppm/Imager.ppd.

This code is free under the GNU GLP (see code header of Fav_2_Png.pm). For a general image-conversion program, see our image converter; for other PNG-supporting applications, see libpng.org.

fav2png.pl

fav2png.pl is a wrapper around the real functionality in Fav_2_Png.pm, to make testing easier. The default image is expected in fav_default.png, and cached images are stored in a folder called img_cache.

Fav_2_Png.pm

Simple usage

The simplest usage is to call the script directly as the image source:

Faster loading

If you have a lot of fav2png images on the same page, there can be a small delay while the perl script serves up the current version. In this case, you can use javascript to first load the previous cached version directly, and then let the perl script give you the current version. I've used the script/noscript construct to handle browsers with javascript disabled:

The source for fav2png.js is shown below.

Faster loading with hyperlinks

Finally, here's the HTML for faster loading, with the images hyper-linked to the domain:

fav2png.js

And here is the source for fav2png.js:

If you have any problems using this resource, or any suggestions on how it could be improved, please feel free to contact us.

fav2png is listed at: