Re: [CSSWG] Minutes and Resolutions 2009-02-04: box-shadow and border-image

On Feb 12, 2009, at 3:38 PM, Robert O'Callahan wrote:

> On Fri, Feb 13, 2009 at 12:28 PM, Tab Atkins Jr.  
> <jackalmage@gmail.com> wrote:
> On Thu, Feb 12, 2009 at 4:53 PM, Robert O'Callahan <robert@ocallahan.org 
> > wrote:
> > On Fri, Feb 13, 2009 at 11:47 AM, Tab Atkins Jr. <jackalmage@gmail.com 
> >
> > wrote:
> >>
> >> However, could we achieve what we want by simply having each pixel
> >> inherit the highest alpha value of any pixel within X of it, with X
> >> depending on the spread?  Negative spreads would inherit the lowest
> >> alpha instead.
> >
> >
> > Maybe. It's totally unclear to me what "spread" means in this  
> situation, so
> > it's not clear what authors would want or expect.
>
> Well, I don't have a browser on hand right now that implements the
> spread value on box-shadow, so I can't be certain, but what I
> described above *appears* to be what's intended by the spec text.
>
> Firefox 3.1 nightly builds implement 'spread'.
>
> What you describe is equivalent to what 'spread' means today for  
> rectangular boxes, assuming you use Manhattan distances to compute  
> "within X".

Now you are starting to speak a different language than I am used to.  
What I assumed would happen is that I could get an effect similar to  
what I can get in PhotoShop (easily, I might add). In PhotoShop terms,  
the old skool way is by starting with the original silhouette in an 8- 
bit alpha channel, apply a "minimum" filter (that's what PhotoShop  
calls it) to get the spread (which I think might be the same thing as  
what Tab described). Then blur as specified. I can't remember if  
reversing the order of blurring and spreading makes a difference, or  
which is better. The alpha is applied to a solid color as specified.

> But if you have, say, a border of repeating diamond-shaped tiles, I  
> don't really know what authors would want if they use 'spread' with  
> that. But your definition is probably as good as any.

The result of my above description is that you cannot maintain sharp  
points and corners, even with no blur, but that's the way it always is  
when dealing only with rasters. It is what I (or any PhotoShop artist  
who's messed around with spreading shadows) would expect, because  
that's the way its always been. It is what I would get if doing it  
myself in PhotoShop to edit the images directly (I'd actually use  
"layer effects", which creates the same effect in an automated and  
completely painless way, without having to directly manipulate  
channels myself). This is also why when we first discussed spread, I  
suggested that we do not require sharp corners to result from it (it  
says SHOULD now, which is OK).

I wouldn't think it would be very computationally expensive. PhotoShop  
has "layer effects" that creates this type of shadow automatically in  
real time. Sure, PhotoShop usually has huge amounts of RAM, but it  
uses it for multiple layers of much larger images.

Received on Friday, 13 February 2009 04:45:26 UTC