0

Considering Google can't even do it, I'm assuming the answer is "No"?

I just went through the basic suggestions from audreyr's "Favicon Cheat Sheet" and created a favicon.ico file consisting of two optimized png files using ImageMagick like so:

$convert favicon-16.png favicon-32.png favicon.ico

My favicon-16.png file was 137 bytes after optimizing with optipng and my favicon-32.png file was 144 bytes after optimization.

So you can understand my surprise when the combined favicon.ico file created by ImageMagick ended up being 5,430 bytes. Coincidentally, that's the exact same size as Google's official favicon.ico file.

Is 5,430 bytes the absolute minimum size for any true image/x-icon file?

That seems a little excessive when realistically every single browser accessing my favicon.ico file will be extracting the 144 byte 32x32 png version.

darkAsPitch
  • 1,855
  • 4
  • 23
  • 35

1 Answers1

1

If the source favicon-16.png and favicon-32.png are truecolor (RGB888 or RGBA8888), ImageMagick will write an uncompressed 5430-byte ICO file. However, if they are indexed-color (i.e., in PNG8 format) or grayscale the ICO may be smaller (I observe 3638-byte ICO files in these cases).

The images are stored within the ICO in BMP format, not PNG (only 256x256 images get stored in PNG format inside the ICO).

Glenn Randers-Pehrson
  • 11,940
  • 3
  • 37
  • 61