1Windows Icons(1) General Commands Manual Windows Icons(1)
2
3
4
6 Microsoft Windows icon files
7
8
10 A Microsoft Windows icon file contains one or more images, at resolu‐
11 tions up to 256 by 256 pixels and various bpp values. The images are
12 encoded either as Portable Network Graphics file (PNG), or in a format
13 similar to Microsoft's BMP format.
14
15 If encoded as BMP, the image includes an "AND mask", which contains
16 1-bit transparency data. It may also contain additional 8-bit trans‐
17 parency data together with the color information.
18
19
20
21 Color Depth
22 Except for the 16 bits per pixel images and images with bit fields,
23 which both are rare, the colors in all BMP encoded images are RGB with
24 8 bits per channel. Images with bpp values lower than 16 use a pal‐
25 ette.
26
27 I.e. the bpp value gives the number of distinct colors, not the color
28 depth.
29
30
31
32 XOR Mask and AND Mask
33 BMP encoded images contain two pixel maps: The so-called "XOR mask"
34 stores the color information for each pixel, and the "AND mask" stores
35 the transparency belonging to it.
36
37 The names and the function of these maps are most easily understood by
38 looking at how a 1-bpp icon image is rendered on a monochrome screen:
39 The pixels on the screen are logically AND-ed with the bits on the AND
40 mask, then the result is logically XOR-ed with the bits on the XOR
41 mask.
42
43 The result is that if a bit on the AND mask is reset, the corresponding
44 bit on the XOR mask determines the color of the pixel on the screen.
45 If a bit in the AND mask is set and the corresponding bit in the XOR
46 mask is black (reset), the image is transparent. Finally, if the bits
47 are set in both the AND and XOR mask (the pixel on the XOR mask is
48 white), the background of the screen is inverted.
49
50 In color environments, a pixel on the XOR mask outside the opaque area
51 of the image is usually black and sometimes white, but a color other
52 than black and white will hardly give predictable results.
53
54 Since Windows XP, there may also be an 8-bit transparency channel in
55 32-bpp BMP encoded icon images. The AND mask, however, is still
56 required and used e.g. for generating shadows.
57
58 PNG encoded images don't contain AND masks. While rendering a PNG
59 encoded image, Windows constructs an AND mask on the fly from the
60 transparency channel, if present.
61
62
63
64 Evolution of Windows Icons
65 The Windows icon file format has undergone some extensions since it was
66 invented in the mid-eighties for Windows 1:
67
68
69
70 · Windows 1 used monochrome 32x32 icons only.
71
72 · Windows 3.0 added color icons with bpp values up to 8.
73
74 · Windows 4.0 (a.k.a. Windows95) added support for 32-bpp images
75 and resolutions up to 256 by 256.
76
77 · NT 5.1 (a.k.a. Windows XP) added support for the 8-bit trans‐
78 parency channel in the unused bits of 32-bpp images.
79
80 · NT 6.0 (a.k.a. Windows Vista) added support for PNG encoded
81 images
82
83
84
85 Common Resolutions and BPP Values
86 Typical resolutions and bpp values of the Windows shell icons include:
87
88
89 ──────────────────────────────────────────────────────
90 OS resolutions bpp values
91 Windows 3 32x32 1, 4
92
93 Windows 4 16x16, 32x32, 48x48 4, 8
94 NT 5 16x16, 32x32, 48x48 4, 8, 32
95 <TD rowspan=3>NT 6 16x16, 32x32, 48x48 4, 8, 32
96 24x24, 96x96 8, 32
97
98 256x256 32 (PNG encoded)
99
100
101 Within the icon file, the images with low bpp values are usually stored
102 first. With the same bpp value, the images are sorted by resolution,
103 large images first.
104
105
106
107 MIME Type and File Name Extension
108 The MIME type of Windows icon files is registered by IANA as
109 image/vnd.microsoft.icon, but the unofficial name image/x-icon is still
110 widely used.
111
112 The file name extension (used by Microsoft operating systems as file
113 type identifier) is .ico.
114
116 This manual page was generated by the Netpbm tool 'makeman' from HTML
117 source. The master documentation is at
118
119 http://netpbm.sourceforge.net/doc/winicon.html
120
121netpbm documentation 12 April 2013 Windows Icons(1)