All Topics  
ICO (icon image file format)

 

   Email Print
   Bookmark   Link






 

ICO (icon image file format)



 
 
The ICO file format is an image file format
File format

A file format is a particular way to encode information for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa....
 used for icons
Icon (computing)

On computer displays, a computer icon is a small pictogram. Icons have been used to supplement the normal alphanumerics of the computer. Modern computers now can handle bitmapped graphics on the display terminal, so the icons are widely used to assist users....
 in Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
. The CUR file format for cursors is almost identical, as the only differences are the identification byte and a specification of a hotspot in the header
Header (information technology)

In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header are sometimes called the Payload or body....
.

ICO files contain one or more small images at multiple sizes and colour depths.

The official IANA
Internet Assigned Numbers Authority

The Internet Assigned Numbers Authority is the entity that oversees global IP address, root nameserver for the Domain Name System , Internet media type, and other Internet protocol assignments....
 registered MIME
MIME

Multipurpose Internet Mail Extensions is an Internet standard that extends the format of electronic mail to support:* Text in character sets other than ASCII...
 type for ico files is image/vnd.microsoft.icon.






Discussion
Ask a question about 'ICO (icon image file format)'
Start a new discussion about 'ICO (icon image file format)'
Answer questions from other users
Full Discussion Forum



Encyclopedia


The ICO file format is an image file format
File format

A file format is a particular way to encode information for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa....
 used for icons
Icon (computing)

On computer displays, a computer icon is a small pictogram. Icons have been used to supplement the normal alphanumerics of the computer. Modern computers now can handle bitmapped graphics on the display terminal, so the icons are widely used to assist users....
 in Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
. The CUR file format for cursors is almost identical, as the only differences are the identification byte and a specification of a hotspot in the header
Header (information technology)

In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header are sometimes called the Payload or body....
.

ICO files contain one or more small images at multiple sizes and colour depths.

The official IANA
Internet Assigned Numbers Authority

The Internet Assigned Numbers Authority is the entity that oversees global IP address, root nameserver for the Domain Name System , Internet media type, and other Internet protocol assignments....
 registered MIME
MIME

Multipurpose Internet Mail Extensions is an Internet standard that extends the format of electronic mail to support:* Text in character sets other than ASCII...
 type for ico files is image/vnd.microsoft.icon. Before this was registered, image/x-icon was the accepted option that complied with the rules of using x- for unregistered tokens. However, many others are seen, including image/ico, image/icon, text/ico, and application/ico. Many web server
Web server

The term web server can mean one of two things:# A computer program that is responsible for accepting Hypertext Transfer Protocol requests from clients , and Server them HTTP responses along with optional data contents, which usually are web pages such as Hypertext Markup Language documents and linked objects ....
s do not come configured with a MIME type setting for .ico files, and may send their default MIME type, which might be text/html or text/plain.

Icon sizes, colour depths, and transparency data

Originally 32×32 pixels square and using 16 colors, more recent versions of Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 support icons at multiple sizes and color depth
Color depth

Color depth or bit depth, is a computer graphics term describing the number of bits used to represent the color of a single pixel in a Raster graphicsped image or video frame buffer....
s. Prior to Windows XP
Windows XP

Windows XP is a line of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptop, and media centers....
, icon images could be any size from 1×1 pixel up to 255×255 pixels (including non-square sizes), and 4-, 8-, 16-, or 24-bit colour depth. Commonly an icon file would contain both 16x16 and 32x32 (for the start menu and folder "large icons" view) and 16x16 (for window title bars, submenus of the start menu and folder small icons, list and details views).

Icon image data was always made up of two bitmap
Bitmap

In computer graphics, a bitmap or pixmap is a type of computer storage organization or used to store digital images. The term bitmap comes from the computer programming terminology, meaning just a map of bits, a spatially mapped bit array....
s: the AND bitmap and the XOR bitmap. The AND bitmap is 1 bit per pixel and is applied first to decide which areas of the image are affected by the background. The XOR bitmap is then applied using XOR. This allows for transparent
Transparency (graphic)

Transparency is possible in a number of graphics file formats. The term transparency is used in various ways by different people, but at its simplest there is "full transparency" i.e....
 areas in the image but also allows for inverting the background and other tricks.

Windows XP
Windows XP

Windows XP is a line of operating systems produced by Microsoft for use on personal computers, including home and business desktops, laptop, and media centers....
 adds support for 32-bit colour depth icon images, with transparency taken from the alpha channel of the image, allowing semitransparent areas like shadow
Drop shadow

In computer graphics, a drop shadow is a visual effect consisting of drawing that looks like the shadow of an object, giving the impression that the object is raised above the objects behind it....
s and antialiased
Anti-aliasing

In digital signal processing, anti-aliasing is the technique of minimizing the distortion artifacts known as aliasing when representing a high-resolution signal at a lower resolution....
 edges. As the AND bitmap is no longer used, these icon images contain only XOR bitmap data. Windows XP also adds the ability to display icons at up to 96×96 pixel resolution in the graphical shell; however, Microsoft only recommended icon sizes up to 48×48 pixels, so larger icon sizes are uncommon.

Windows Vista
Windows Vista

Windows Vista is one member in a family of operating systems developed by Microsoft for use on personal computers, including home and business Desktop computer, laptops, Tablet PCs, and media center PCs....
 adds support for 256×256 pixel icon images, and supports (but does not require) the compressed
Data compression

In computer science and information theory, data compression or source coding is the process of encoding information using fewer bits than an code representation would use through use of specific encoding schemes....
 PNG format for that size. The PNG format encodes the image transparency data directly; it contains neither the XOR nor the AND bitmap data of the other icon image formats. It is recommended that all 256×256 icons should be stored in the ICO file in PNG format to reduce the overall size of the file. The Windows Vista graphical shell supports "zooming" the display in and out; as a result, more icon formats (including the larger, 256×256 format) are recommended.

ICO files can be edited or exported with a number of graphics programs, among them CorelDraw
CorelDRAW

CorelDRAW is a vector graphics editor developed and marketed by Corel of Ottawa, Canada. It is also the name of Corel's Graphics Suite. Its latest version, named X4 , was released in January 2008....
 and IrfanView
IrfanView

IrfanView is a freeware for Microsoft Windows that can view, edit, and convert image files and play video/audio formats. It does not have extensive image creation and painting capabilities like Adobe Photoshop, Pixel image editor, Paint.NET or GIMP....
.

Icon library

An icon library is a way to package Windows icons. It is typically a New Executable
New Executable

The NE, abbreviation for New Executable, is an executable file format that was introduced with MS-DOS 4.0 , and that was also used later in OS/2 and 16-bit Microsoft Windows....
 binary having .ICL extension with icon resource
Resource (Windows)

In Microsoft Windows, resources are read-only data embedded in EXE or Dynamic-Link Library files.The Windows API provides for easy access to all applications' resources....
s being the packaged icons.

File structure

All values are represented in little-endian
Little-endian

Little-endian may refer to:* A philosophical viewpoint held by inhabitants of the island of Lilliput and Blefuscu from the book Gulliver's Travels by Jonathan Swift....
 (Intel standard) format.

Icon Header Stores general information about the ICO file.
Directory[1..n] Stores general information about every image in the file.
Icon #1 The actual "data" for the first image in old AND/XOR DIB format or newer PNG
... 
Icon #n Data for the last icon image


Header

Offset# Size Purpose
0 2 reserved. should always be 0
2 2 type. 1 for icon (.ICO), 2 for cursor (.CUR) file
4 2 count; number of images in the file


Directory

Offset# Size Purpose
0 1 width, should be 0 if 256 pixels
1 1 height, should be 0 if 256 pixels
2 1 colour count, should be 0 if more than 256 colours
3 1 reserved, should be 0
4 2 colour planes when in .ICO format, should be 0 or 1, or the X hotspot when in .CUR format
6 2 bits per pixel when in .ICO format, or the Y hotspot when in .CUR format
8 4 size in bytes of the bitmap data
12 4 offset, bitmap data address in the file


Recommended icon sizes for Windows Vista compatibility

The full set of standard icon sizes which should be provided for full Windows Vista compatibility:

  1. 256×256, 32-bit color, PNG compressed
  2. 48×48, 32-bit color, uncompressed
  3. 48×48, 8-bit color, uncompressed
  4. 48×48, 4-bit color, uncompressed
  5. 32×32, 32-bit color, uncompressed
  6. 32×32, 8-bit color, uncompressed
  7. 32×32, 4-bit color, uncompressed
  8. 16×16, 32-bit color, uncompressed
  9. 16×16, 8-bit color, uncompressed
  10. 16×16, 4-bit color, uncompressed


See also

  • Windows bitmap, a very similar file format
    • (Note that many of the external links in that article are relevant to ICO files as well).
  • Apple Icon Image
    Apple Icon Image

    The Apple Icon Image format is the icon format used in Apple Inc.'s Mac OS X. It supports icons of 16?16, 32?32, 48?48, 128?128, 256?256 and 512?512 pixels, with both bit and 8-bit Alpha compositings and multiple image states ....
    , the icon format used in Mac OS X
    Mac OS X

    Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
    .
  • Favicon
    Favicon

    A favicon , also known as a website icon, shortcut icon, url icon, or bookmark icon is a 16x16 pixel square icon associated with a particular website or webpage....
    , an icon format used for websites
  • Icon editor
    Icon editor

    An icon editor is software for creating and editing Icon .Icon editors usually contain a rudimentary raster image editor capable of modifying images of an icon pixel by pixel, by using simple drawing tools, or by applying simple image filters....


External links

  • (Out of date. Does not include Vista additions.)
  • Also includes a detailed technical explanation of the icon format, including the Windows Vista additions.