Trivial tool that combines multiple ICO/PNGs into single .ICO file that keeps format of each sub-image.
Command line:
icomake.exe output.ico input1 [input2 [...]]
Input file formats supported:
Outputs single ICO file containing all input images.
Windows Vista and later supports ICO files that contain PNG sub-images. Most graphics applications (at least those that I use) will only save the 256×256 one as PNG, but all, even 16×16, can safely be PNGs too. Thus enter the purpose of this tool, as PNGs are by magnitudes smaller than uncompressed bitmaps.
Note: In order for ICOs to show on Windows XP and older, and perhaps other OSs, at least some icons should be stored as bitmaps. At least 32×32 icon, ideally also 16×16, 24×24, and 48×48. This tool does not and can not convert PNG to BMP ICO.
Windows icon loader iterates over all icons in file, assessing difference between requested and available icons, stopping only on exact match. The assessment is in both resolution and color depth, preferring resolution over color depth; only to a certain degree though.
In attempt to save it a few cycles and trigger the early return on match, this tool places the most probable icons first. It also honors Microsoft's guidelines for XP software by placing the most common 9 icon sizes first. If all resolutions were available, the order would be following:
Of course, whether this is the best order is open for a debate.