What is Icon?
In this manual:
- What's the difference between icon and image?
- Icon structure
- What is RGB/A format?
- Which formats are to be included in icon?
The Windows operating systems family represent icon as a file of graphics with the .ICO extension. Many tend to assume that icon is a regular image that stores some graphics. However, it is much more complex. Some image formats, such as JPG, BMP, PNG, and GIF, have different attributes, such as size, color depth, animation cycle, etc. Unlike these formats, icon consists of a collection of images of different sizes with a specific number of colors. An actual icon is a container for several images for all cases that may occur in an operating system. The collection of these formats is standardized; there are several predefined sizes. For example: 16x16, 24x24, 32x32, and 48x48, and there is a number of standard color depths: mono, 16 colors, 256 colors, True Color (16.8M). All that is necessary to ensure the correct appearance of an icon regardless to the version of Windows it is used under and regardless to the screen and hardware settings. Yet another moment worth noticing - each format within an icon can carry data on the transparent areas within its size, which allows users to see the background picture behind the icon and give it a custom shape instead of sticking with the ugly square pictograms.
As it was mentioned above, icon is a collection of different formats. For the sake of better perception, each format can carry different content, depending on the size and number of colors for that format. For icons used in Windows XP, there is a standard. The icon must contain 12 formats. Here is the table of all formats that are to be included in the icon:
This number of different sizes is necessary because the operating system uses different icon formats for displaying the icons in each particular case. For example, desktop icons are displayed in the format of 32x32 pixels, taskbar icons - 16x16, Windows Explorer in the Tile view mode - 48x48 pixels. Besides all sizes, the icon must contain their copies in other color mode to ensure the correct operation with old video cards and old operating systems, such as Windows 2000, Windows 98, and Windows 95 which do not support the RGB/A format.
Windows XP operating system has an innovation - the icon standard has adopted a new color format, the so-called RGB/A format, also known as True Color XP. In this format, each pixel is represented with 4 bytes. Three of those are the Red, Green, and Blue channels, and the fourth one is the Alpha-Channel, which defines smooth transparency for each pixel. We are going to cover this format below, in the article What is RGB/A format?
We must also notice the new size - 24x24. This format is used by Windows XP operating system for dislaying icons on the Start menu. However, unfortunately, an .ICO-file icon that contains this format does not appear when viewing in Windows Explorer. This format is normally included in the icon when it is to be used for applications or Toolbars.
For more information on icon formats, you can read the Creating Windows XP Icons manual by Microsoft.
The Microsoft Windows XP operating system supports the new generation of icons format. What sets it aside of the previous standards is it supports the so-called RGBA format, also known as True Color XP. An image in this format may contain up to 16.8 million colors; this format supports the so-called Alpha-Channel, which defines the transparency for each pixel of the image. Each color band has eight bits, and the alpha-channel has the same band. In total, one pixel of this image format takes 32 bits; therefore, such images are also called 32-bit images. To make this clearer and help you understand what this format is made of, take a look at this figure:
Red, Green, and Blue channels combined make a certain color for a pixel, and the alpha-channel is used for masking that color. The opacity of the alpha-channel, or the transparency, in other words, can vary between 0 and 255. On this diagram we can see that all white pixels on the drawn alpha-channel will be visible, all black ones will be invisible, and the grey pixels will be semi-transparent.
The major advantage of the RGBA format is in its capability to display the smooth, pleasant for human eye transparency, which makes the image look properly regardless to the background image. Besides that, a full-color icon is much brighter and more attractive than a poor 256-bit one. Also, the eight-bit alpha-channel has allowed applying aesthetical shadow to icons. It's really hard to underestimate the benefits made available by this format. Here is a comparison between Windows XP icons and formats used in the older versions of the operating system, aush as Windows 98 and Windows 2000.
Comparison: Standard 256-bit icon vs. True Color XP icon:
There are several ways you can use .ico files:
- As application icons. In this case, by the
standard, you will need to include all 12 formats:
- As shortcut or folder icons. If you want to use
an icon for shortcut or folder, you will need to remove all formats of 24x24
from it, for Windows Explorer does not show such icons in the system.
- Other cases. Often times, when you know in advance, which sizes and color schemes are going to be used, there is not much sense in including all formats in the icon just because the standards demand so. You can just leave the icons you are going to need for sure and get rid of the rest to avoid redundant design expenses.