3 ms·
Yes, there are fewer requests that way, but the cost is an increase in the total data size. Using a single sprite sheet for all the images would probably be fa
by BHSPitMonkey 15y ago
Yes, there are fewer requests that way, but the cost is an increase in the total data size. Using a single sprite sheet for all the images would probably be faster in most cases. However, there is the matter of convenience (it's nice being able to have just a single file with no dependencies).
- ceol 15y agoBase64-encoded images can't be cached, either.
- tubes 15y agogzipped base64-encoded data is about the same size as the original data, though. It only requires more processing to be done.
- jonknee 15y agoIt depends on what you're doing with the image. You can't always tile a sprited image for example, which is a nice advantage for base64 encoding. Size wise they're pretty similar once you count gzipping, though you do have more overhead on base64 since each will have its own set of image headers vs just one for the sprite.
- infinite8s 15y agoThe best is a single sprite sheet encoded into the source file (I believe this is what the Cappuccino framework does for some of the images that make up some UI elements).