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

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

From: Glenn Maynard <glenn@zewt.org>
Date: Mon, 12 Aug 2013 20:45:21 -0500
Message-ID: <CABirCh9RSb0SEMsqy9KHEV77h7s04hgq7G6evCYLFRM10Kh+1A@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: WHAT Working Group <whatwg@whatwg.org>, bdahl@mozilla.com, Stephen White <senorblanco@chromium.org>, w3c@junglecode.net
On Sat, Aug 10, 2013 at 9:43 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> Ah, so you are relying on pixel snapping (=rounded up to 2 pixels).
>

Rounded to the nearest integer pixel.  If you give 1.25, the width would be
1.


> If you can do that with your approach, why not with strokes that are drawn
> from the center?
>

It might be possible, in principle, to only snap the "border" of the stroke
instead of the whole thing, but I don't know how to do that or if it'd be
worthwhile.  It seems like sharp lines are only particularly important for
thin strokes (especially 1px), and in those cases the difference between a
center and an outer stroke are minor.  (I don't know if it's harder to
implement, eg. so there's no gap between a fill followed by an outer
stroke.)

I was wondering if this is something that happens in Flash as well. It
> turns out that there's an option called "hinting: Keep stroke anchors on
> full pixels to prevent blurry lines." There's a blog post on what this
> does:
> http://www.kaourantin.net/2005/08/stroke-hinting-in-flash-player-8-aka.html <http://www.kaourantin.net/2005/08/stroke-hinting-in-flash-player-8-aka.html>
>

I don't know about this, but the description sounds similar to what I'm
suggesting.

-- 
Glenn Maynard
Received on Tuesday, 13 August 2013 01:45:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:23 UTC