开发者

What is the max possible size of an 32x32px .ico file?

开发者 https://www.devze.com 2022-12-22 22:21 出处:网络
I\'m making a favico开发者_开发技巧n.ico script, and I need to know the max amount of bits possible. It depends on the number of colours you are using.

I'm making a favico开发者_开发技巧n.ico script, and I need to know the max amount of bits possible.


It depends on the number of colours you are using.

For 8bit (256 colours):

32 * 32 * 8 = 8192 bits
8192 / 8 = 1024 bytes
1024 bytes = 1Kb

For 32bit (16.7 million colours):

32 * 32 * 32 = 32768 bits
32768 / 8 = 4096 bytes
4096 bytes = 4Kb

See wikipedia.


It maxes out at 32 bits per pixel, 24 RGB plus alpha transparency, so that would be 32 x 32 x 32, or 32768 bits.

So 4096 bytes (4K).


In theory, a single ico file can contain up to 65,535 images (see header description). That would mean that the maximum number of pixels could be as large as 65535*32*32, which at 4 bytes per pixel comes to 268,435,456 bytes.

0

精彩评论

暂无评论...
验证码 换一张
取 消