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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 13 Feb 2009 07:33:16 -0600
Message-ID: <dd0fbad0902130533s22bd97ev809d9a98544d7c44@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: robert@ocallahan.org, David Hyatt <hyatt@apple.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>

On Thu, Feb 12, 2009 at 10:44 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>
> On Feb 12, 2009, at 3:38 PM, Robert O'Callahan wrote:
>> 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.

Yup, the minimum filter in Photoshop is exactly what I described.

> 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.

If you use manhattan distance (the easiest and fastest distance), you
maintain sharp corners.  You only lose them when you use euclidean
distance (much slower, because it involves two multiplications and a
square root), or something similar.  Photoshop seems to use a
Euclidean distance, since it specifically refers to a 'radius'.  Under
a manhattan distance metric, a 'circle' is square.  ^_^

I'm perfectly happy with the result of keeping corners sharp, and the
fact that it matches up with what is probably the most performant
method (I only say 'probably' because I don't know exact details of
the rendering engines, but I'm nearly certain I'm right) is just an
added bonus.

~TJ
Received on Friday, 13 February 2009 13:33:54 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:16 GMT