W3C home > Mailing lists > Public > www-style@w3.org > September 2009

Re: Image sprites use cases

From: Brad Kemper <brad.kemper@gmail.com>
Date: Sun, 6 Sep 2009 09:51:52 -0700
Message-Id: <D7AC64EC-A263-44C5-9C1F-DCD7D89FBC0C@gmail.com>
To: Aryeh Gregor <Simetrical+w3c@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "www-style@w3.org" <www-style@w3.org>
On Sep 6, 2009, at 9:29 AM, Aryeh Gregor <Simetrical+w3c@gmail.com>  

> On Sun, Sep 6, 2009 at 11:43 AM, Brad Kemper <brad.kemper@gmail.com>  
> wrote:
>> No more so than any "new" image format, such as gradients (not that  
>> layered
>> image formats like Photoshop files, TIFF, etc., are particularly  
>> new).
> It's acceptable if gradients fall back to a solid color, if it affects
> a reasonably small percentage of users.  I don't think there's any
> acceptable general fallback for image sprites.  Showing the first
> image surely isn't very useful in general -- most sprites I've seen
> contain a number of unrelated images.

Most I've used have been related images, such as the different states  
of a button, tab, icon, etc. So it wouldn't be terrible to have it  
fallback to a single image.

> The proposed archive-based
> solution has excellent fallback: a slight performance hit, nothing
> else.

If the only reason you are using sprites is to have better loading  
performance, then the proposed archive-based solution would be your  
best bet. If you currently put all your entire site's images into one  
file and use background positioning and clipping to access it in order  
to save a little loading time, then clearly it would be better to use  
a zip file instead.

But mostly I see sprites being used in places where where there is  
some logical connection between the different parts, and where each  
part is used on the same element at the same size, in the same places,  
exactly like switching between layers.

> There's no reason you couldn't write a Photoshop plugin that lets you
> edit an archive file all at once, if you felt like it.  If you cared
> about fallback, you'd then have to extract it in place when you upload
> the new version.  Seems like no big deal.

That does not sound nearly as nice as what I've proposed. 
Received on Sunday, 6 September 2009 16:52:40 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:39 UTC