W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2013

Re: [whatwg] Blurry lines in 2D Canvas (and SVG)

From: Kevin Marks <kevinmarks@gmail.com>
Date: Thu, 25 Jul 2013 13:16:36 -0700
Message-ID: <CAD6ztsrO4Ta+05NNjXAV9fypUgFVRkFKsDn9bJ4mPpE+uArt2g@mail.gmail.com>
To: ddailey <ddailey@zoominternet.net>
Cc: WHAT Working Group Mailing List <whatwg@whatwg.org>, Rik Cabanier <cabanier@gmail.com>
On chrome android I see the opposite - the left rests are sharp, the middle
ones fuzzy. Sounds like tests needed.
On Jul 23, 2013 5:18 PM, "David Dailey" <ddailey@zoominternet.net> wrote:

> Hi Rik,
>
> Just affirming what you've said in SVG:
> http://cs.sru.edu/~ddailey/svg/edgeblurs.svg
>
> The middle rects are crisp, having been merely translated leftward and
> downward by half a pixel. Zooming in from the browser rectifies the problem
> (as expected) after a single tick.
>
> I remember folks discussing sub-pixel antialiasing quite a bit on the SVG
> lists circa fall/winter 2011. It seemed to cause some troubles for D3. Is
> that the same issue?
>
> Cheers
> David
>
>
> -----Original Message-----
> From: whatwg-bounces@lists.whatwg.org
> [mailto:whatwg-bounces@lists.whatwg.org] On Behalf Of Rik Cabanier
> Sent: Tuesday, July 23, 2013 7:19 PM
> To: whatwg@whatwg.org
> Subject: [whatwg] Blurry lines in 2D Canvas (and SVG)
>
> All,
>
> we've noticed that if you draw lines in canvas or SVG, they always end up
> blurry.
> For instance see this fiddle: http://jsfiddle.net/V92Gn/128/
>
> This happens because you offset 1 pixel and then draw a half pixel stroke
> on
> each side. Since it covers only half the pixel, the color gets mapped to
> 50%
> gray.
> You can work around this by doing an extra offset of half the
> devicepixelratio, but ideally this should never happen.
>
> Is this behavior specified somewhere?
> Is there a way to turn this off?
>
>
>
Received on Thursday, 25 July 2013 20:17:02 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:03 UTC