-->

using an image sprite for a gallery

2019-06-27 04:39发布

问题:

Slow load time due to too many images and too large images (file size). I have already begun converting some PNG to JPG and was considering exploring the idea of changing the current image slider/gallery (series of 6 rotating JPG images) to a single sprite. I'm not sure if it's even possible or worth all the effort.

I'm aware that the background images are the meat of the issue and I am already working on changing them to JPGs and and reducing their file size. The link is below, if any experienced html/css/js/jquery person could advise if it's 1) possible to use an image sprite for the gallery/slider and 2) worth it? Will it help load times?

http://tinyurl.com/7ywoqpf

回答1:

I don't suggest using an image sprite for a gallery. If you ever want to change anything, you have to modify the sprite. Now make, say, five changes to your site and that's 5 modifications to the sprite. It's better to use properly optimized, independent images for that. That way you just modify the order of appearance with ease as well as change images on a case per case basis.

Go to this URL if you need heavy, LOSSLESS compression of your images:

http://kraken.io/

I use it for basically any heavy-duty project I'm working on.

Hope this helps G