Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my favicon.ico file so much larger than the sum of its parts?

I have created a favicon.ico file that contains three sizes of .png icon sizes, 16px, 32px, and 64px.

In my Mac Finder, I have their sizes at 339b, 1kb, and 4kb respectively after optimizing them using ImageOptim. So let's maybe round up to 6kb?

However, when I run this ImageMagick command:

convert 16.png 32.png 64.png myfav.ico

The resulting .ico file is 22kb!

This is a pretty large file and unexpected.

What did I do wrong? What can I do to make it smaller (if anything)?

like image 611
Drewdavid Avatar asked Jul 14 '15 00:07

Drewdavid


1 Answers

The ico file itself is not a compressed one.

You can gzip it and you will see that the gzipped size will be lesser than the summation of the sizes the 3 png files. ico files are most frequently gzipped (using apache, nginx and so on) before being used to reduce the size.

So, the reason they are so big is because the compression algorithm is weak.

like image 200
AbdealiJK Avatar answered Oct 24 '22 04:10

AbdealiJK