I'm Dudley Storey, the author of Pro CSS3 Animation. This is my blog, where I talk about web design and development with HTML, CSS and SVG. To receive more information, including news, updates, and tips, you should follow me on Twitter or add me on Google+.

my books

Pro CSS3 Animation, Apress, 2013

Using SVG with CSS3 and HTML5, O'Reilly, 2017

my other blogs

Massive Head Canon: Intelligent discussion of movies, books, games, and technology.

my projects

The New Defaults — A Sass color keyword system for designers. Replaces CSS defaults with improved hues and more memorable, relevant color names.

CSSslidy — an auto-generated #RWD image slider. 3.8K of JS, no JQuery.

Creating Multi-Resolution Favicons For Web Pages With GIMP

Advanced favicons for modern browsers

As I’ve previously discussed, favicons are moving on from simple 16 × 16 pixel images, evolving into multi-resolution images used for many different purpose. This lesson will show you how to create modern, multi-layer favicons… but before we begin, there are a few provisos to be aware of:

  1. You may find that multi-resolution favicons do not work on older browsers, including Firefox 5 or lower. If you know (or believe) that a significant minority of your users have not upgraded, you’ll probably want to stick with traditional favicons

  2. As you will see, multi-resolution favicons are created by adding layers to an .ico file; just like adding layers to a PhotoShop .psd image, doing so adds tothe file size. It’s entirely possible to wind up with a favicon more than 50KB in size, which will slow your page load time. Try to keep your .ico file under 20KB; if you can’t, my advice would be to drop the higher resolution layers

  3. As far as I am aware the only cross-platform tool capable of creating multi-resolution favicons is GIMP. Instructions for installing the application on Mac OS X will be included; if you’re on Windows, you will need to find your own way.

Step 1: Create your base, high-resolution image for your favicon

Using whatever tool you wish, create the highest-resolution version of your favicon: I would suggest an image at least 256 × 256 pixels in size. Keep in mind that whatever you create will be reduced down to 16 × 16 pixels for the smallest version, so as a general rule you’ll want to keep your design simple, clear and bold.

Whatever application you are using, make certain that it is setup correctly before you begin: this blog contains an article on the best preference settings for PhotoShop.

Step 2: Export the layers of your favicon as PNG files

Reduce the size of your image to the appropriate resolutions and export; I would suggest the following:

SizeFile namePurpose
114 × 114apple-touch-icon-precomposed.png

Used for the “Add to home screen” feature in iPhone, iPod Touch, iPad and Android devices

110 × 110facebook.png     

The thumbnail image used for Facebook shares and likes

64 × 64favicon64.png

Currently used by IE; and (potentially) by browsers on high-resolution displays in the near future.

32 × 32favicon32.png
24 × 24favicon24.png
16 × 16favicon16.png

Work from the largest format down the smallest, exporting each version as a separate file. The apple-touch-icon-precomposed.png and facebook.png versions will not be used in the steps that follow: they are reserved for use as icons for mobile and social media platforms, explained in future articles.

You should try to optimize your PNG files whenever possible: as an option, the favicon can contain alpha transparency.

Step 3: Install GIMP

GIMP (GNU Image Manipulation Program) is a free, open source alternative to PhotoShop. It runs within the X11 Windowing system, so the first step we must take is to ensure that the OS is available. Thankfully, if you are using OS X 10.5 (Leopard) or above, it is already installed by default; those using earlier versions of OS X will have to install X11 on OS X for themselves.

Download the appropriate version of GIMP for OS X, install and run it. (You may find that it takes several minutes for GIMP to start up the first time, as it has to start X11 before it loads).

Step 4: Open the highest resolution of the icon & use “Open As Layers” to import your PNG files

The interface for GIMP is significantly different from the standard Mac OS X and Windows interface: for example, the menu bar is at the top of GIMP’s window, rather than the top of the screen. Open the 64 × 64 pixel version of the icon. If you’re asked to set the working current color profile, go with the suggestion of RGB workspace.

Then right-click on the image in GIMP and choose File / Open as Layers… Choose the other favicons, from largest to smallest. 

Step 5: Export the image as a favicon

Use File / Save As… and provide the correct file name (favicon.ico). You can opt to compress the PNGs further at this stage.

Step 6: Insert the favicon into your web page(s)

With the following code in the <head> of every web page on our site that we wish to use the favicon, listing the icon sizes you have used:

  1. <link rel=“icon” href=/favicon.ico sizes="16x16 32x32 48x48 64x64"
  2. type=”image/vnd.microsoft.icon”>

That’s it: you now have a modern, multi-resolution favicon. In articles to come I’ll discuss using the other PNG versions that we created during this process for mobile and social media platforms.

This site helps millions of visitors while remaining ad-free. For less than the price of a cup of coffee, you can help pay for bandwidth and server costs while encouraging further articles.