开发者

transparency in CSS sprites

开发者 https://www.devze.com 2023-03-18 05:37 出处:网络
So I am doing my first site with CSS sprites and I was wondering when saving an images as a .png does the amount of whitespace in-between images have an impact on the performance of the image?

So I am doing my first site with CSS sprites and I was wondering when saving an images as a .png does the amount of whitespace in-between images have an impact on the performance of the image?

For Instance if I where to crame 10 images into a very small canvas would it be smaller then if I where to crame the same 10 images into a nicely spaced o开发者_C百科ut image?


PNG does a pretty good job of compressing white space between images so the download size impact of spacing them out is probably very small. The larger image could have a performance impact when decompressed on the browser end, but this will likely only be noticeable on very small systems.

But overall, there is no disadvantage to packing the images in tightly so I would definately suggest doing so.


The more pixels in the image, the more memory taken up when it is converted into an uncompressed bitmap in memory.

This can have a performance impact, especially on low memory systems (it has been quite noticeable on some of the embedded browsers on TVs and set top boxes that I've been working with recently).

0

精彩评论

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