Apple Icon Image format

Apple Icon Image
Filename extension .icns
Type code icns
Uniform Type Identifier com.apple.icns
Developed by Apple Inc.
Type of format icon file format

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 1- and 8-bit alpha channels and multiple image states (example: open and closed folders). The fixed-size icons can be scaled by the operating system and displayed at any intermediate size.

Contents

File structure

The file format consists of an 8 byte header, followed by any number of icons.

Header

Offset Size Purpose
0 4 Magic literal, must be "icns" (0x69, 0x63, 0x6e, 0x73)
4 4 Length of file, in bytes

Icon data

Offset Size Purpose
0 4 Icon type, see OSType below.
4 4 Length of data, in bytes (including type and length)
8 Variable Icon data

Compression

Over the time the format have been improved and there is support for compression of some parts of the pixel data. The 32-bit ("is32", "il32", "ih32","it32") pixel data is often compressed (per channel) with the PackBits algorithm.
Some sources mentioned that the OS supports both compressed or uncompressed data chunks.

Icon types

OSType Length (bytes) Size (pixels) Description
ICON 128 32 32×32 1-bit mono icon
ICN# 256 32 32×32 1-bit mono icon with 1-bit mask
icm# 24 16 16×12 1 bit mask
icm4 96 16 16×12 4 bit icon
icm8 192 16 16×12 8 bit icon
ics# 32 16 16×16 1-bit mask
ics4 128 16 16×16 4-bit icon
ics8 256 16 16x16 8 bit icon
is32 varies (768) 16 16×16 24-bit icon
s8mk 256 16 16x16 8-bit mask
icl4 512 32 32×32 4-bit icon
icl8 1,024 32 32×32 8-bit icon
il32 varies (3,072) 32 32x32 24-bit icon
l8mk 1,024 32 32×32 8-bit mask
ich# 288 48 48×48 1-bit mask
ich4 1,152 48 48×48 4-bit icon
ich8 2,304 48 48×48 8-bit icon
ih32 varies (6,912) 48 48×48 24-bit icon
h8mk 2,304 48 48×48 8-bit mask
it32 varies (49,152) 128 128×128 24-bit icon
t8mk 16,384 128 128×128 8-bit mask
ic08 varies 256 256×256 icon in JPEG 2000 or PNG format
ic09 varies 512 512×512 icon in JPEG 2000 or PNG format
ic10 varies 1024 1024×1024 icon in PNG format (added in Mac OS X 10.7)

Icons created with 10.7's Icon Composer contain a 'TOC ' entry at the beginning that lists all of the image types contained within the icon and their size.

Some newer icons contain a 'icnV' entry at the end that is 12 bytes long (4 bytes data length). The last 2 bytes appear to always be 0, however the meaning of the other two bytes is unknown.

See also

External links