.ico files can contain multiple images with different resolutions. This allows the program displaying the icon to choose the most appropriate size depending on the context. For example, Windows Explorer can display icons at 16, 32, 48, or 256 pixels (more info). There are several ways to generate an ICO file, but many only support a single image size or do not handle transparency properly.
After some research, I came across png2ico, a free tool. The website looks basic, but the tool works well for this purpose. To use it, run the following command in a terminal:
Shell
png2ico.exe "favicon.ico" "logo_16x16.png" "logo_32x32.png" "logo_48x48.png" "logo_64x64.png"
Do you have a question or a suggestion about this post? Contact me!