Image Published 2024-12-21

The ICO File Format: Binary Headers, Icon Directories, and Multi-Res PNGs

Explore the binary architecture of the Windows ICO container: ICONDIR structures, BITMAPINFOHEADERs, and embedded PNG frames. In this comprehensive technical guide, we examine the underlying mechanics, practical implementation workflows, and industry best practices.

Binary Structure of the ICO Container

An ICO file starts with a 6-byte ICONDIR header followed by 16-byte ICONDIRENTRY descriptors specifying dimensions, color depth, and byte offsets for each embedded resolution.

Embedding Modern PNG Payloads

Modern ICO containers directly encapsulate full compressed PNG files, allowing multi-resolution icons (16px, 32px, 48px, 256px) with smooth alpha transparency in tiny file sizes.

Conclusion

Packing modern 16px, 32px, and 48px PNG frames into a well-crafted ICO container ensures crisp icon rendering across legacy Windows desktops and modern browser address bars.