ICO files contain one or more small images at multiple sizes and color depths, such that they may be scaled appropriately.
The only differences between these two file formats are the bytes used to identify them and the addition of a hotspot in the CUR format header; the hotspot is defined as the pixel offset (in x,y coordinates) from the top-left corner of the cursor image where the user is actually pointing the mouse.
[citation needed] Win32 introduced support for storing icon images of up to 16.7 million colors (TrueColor) and up to 256×256 pixels in dimensions.
Windows XP added support for 32-bit color (16.7 million colors plus 8-bit alpha channel transparency) icon images, thus allowing semitransparent areas like shadows, anti-aliasing, and glass-like effects to be drawn in an icon.
[6] Windows XP can downscale larger icons if no closer image size is available.
The Windows Vista shell adds a slider for "zooming" the icon sizes in and out.
With users using higher resolutions and high DPI modes, larger icon formats (such as 256×256) are recommended.
[7][8] While the IANA-registered MIME type for ICO files is image/vnd.microsoft.icon,[9] it was submitted to IANA in 2003 by a third party and is not recognised by Microsoft software, which uses image/x-icon or image/ico instead.
However, earlier versions of Windows interpret all pixels with 100% opacity unless an AND mask is supplied with the image.
Note that the quantity of padding bytes needed depend on the dimensions of the bitmap and not its color depth since the AND mask is 1 bit per pixel regardless.
Originally, ICOs and CURs were intended to be used on monochrome displays and used the formula Output = (Existing AND Mask) XOR Image but on colour screens, the cursor is composed using A channel blending and the mask is used to determine which pixels are included or excluded.
[7] Icons and cursors in Portable Executable (EXE or DLL) files are organised in resources of type RT_GROUP_ICON, RT_GROUP_CURSOR, RT_ICON and RT_CURSOR.
Main difference is in RESDIR that the last member of the structure contains two-byte resource identifier of the RT_ICON/RT_CURSOR instead of image offset in the file.
Windows Vista and later versions do not support viewing icons from 16-bit (New Executable) files.