Icon File (.ico)

From RealWorld Wiki

Jump to: navigation, search

The word icon is used in multiple contexts with different meaning. This article describes computer icons, small pictures found on the Desktop and in various computer programs. The icons represent a function or an aspect of a computer application.

Contents

[edit] Structure of an .ico file

The .ico file is not a single image, but a container of multiple images. Each image has different size and/or color depth. The Windows operating system picks one of the images according to current conditions - the space it has for the icon and the color capabilities of the graphics adapter.

[edit] Sizes

The .ico format is capable of containing images ranging from 1x1 pixel to 256x256 pixels. The images need not to be square.

Windows itself typically uses these sizes:

  • 16x16 pixels - used in menus, toolbars, in Explorer when set to Detail or Small icons modes.
  • 24x24 pixels - used in Start menu of Windows XP.
  • 32x32 pixels - the basic icon size.
  • 48x48 pixels - used in Explorer when set to Tiles mode.
  • 256x256 pixels - used in Windows Vista by Explorer. Images of this size are usually compressed.

These are not the only icon sizes. Users can modify the default icon size in display properties, various application may require icons of different sizes, etc.

When Windows is switched to high resolution (120 DPI or more), the default icon sizes change to 20x20, 30x30, 40x40 and 60x60 pixels or more. A DPI-aware application should be ready for this situation. RealWorld Icon Editor is able to create icons with any number of custom formats.

[edit] Color depths

The image in the .ico container is accompanied by a mask that defines which portions of the image are transparent (that means you can see the background behind the icon).

Valid color depths for the image and for the mask are:

  • 1 bit - black and white and transparent pixels (not used anymore and not supported in Vista).
  • 4 bits - 16 basic colors and transparent pixels. Used on older Windows or when the display driver is not correctly installed on newer Windows. This color depth should be present in an icon.
  • 8 bits - 256 colors and transparent pixels. Main color depth for Windows 2000 and older systems. Used on newer systems when display is switched to "medium" (16 bits) color depth. This color depth should be present in an icon.
  • 24 bits - 16M colors and transparent pixels. A more or less useless format.
  • 32 bits - 16M colors and partially transparent pixels. This color depth is known as XP format and allows smooth icon edges. This color depth should be present in an icon.

[edit] Creating icons

RealWorld Icon Editor allows creation of icons with any number of images in all the available color depths and sizes. There are predefined operations which create icons with the standard formats. Users can customize the generated formats and effects applied during conversion from image to icon.

[edit] More resources

Personal tools