W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] [canvas] inner shadows

From: Glenn Maynard <glenn@zewt.org>
Date: Sat, 24 Nov 2012 09:59:26 -0600
Message-ID: <CABirCh9N7FbncNH_DaJPqb4jF4Ub7s9vRNQra77__KHqmNeEgg@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: whatwg@whatwg.org, Ian Hickson <ian@hixie.ch>
On Fri, Nov 23, 2012 at 11:11 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> What matters is the shape that is used to calculate the blur (step 1)
> In your example, that shape is a rectangle so just the rectangle edges will
> be blurred.
> That slightly blurred rectangle is then composited with the clipping region
> in step 4.
>
> The end result is a solid rectangle in the shadowcolor that composites on
> top of the shape.
>

Testing with Hixie's code (https://zewt.org/~glenn/canvas-glow.html), the
output is very close to "inner shadow" in Photoshop (distance 0, size 22):
https://zewt.org/~glenn/canvas-glow.png.

(I'm testing against inner shadow instead of inner glow; inner glow seems
to do something a little more complex at the blur step than a gaussian
blur.  Tested in Chrome 21; output in Firefox is different, but I probably
need to update.)

-- 
Glenn Maynard
Received on Saturday, 24 November 2012 17:08:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT