Remix.run Logo
zovirl 6 hours ago

Additionally, the file size of the sprite sheet image is often smaller than the combined file sizes of the individual images. (I never looked into why but expect it has to do with sharing overhead and the compression dictionary)

toast0 6 hours ago | parent [-]

Yeah. If your images have similarity at all, being in the same compression container helps a bit; and there is some per file overhead, smallest PNG is reportedly 67 bytes, plus http overhead, and maybe you're serving one request per http connection (but hopefully not for images) . If you're feeling really optimizy, you can probably shuffle the order of the sprites and get bigger or smaller sprite sheets. But then you also need to consider the impact on your css when you shift the sprite sheet around, I don't think that would be big, but it might be.