Re: Minutes, 12 August 2009 SVG telcon

Hi, Folks-

Anthony Grasso wrote (on 8/13/09 12:09 AM):
>
> Regarding ISSUE-2291 that was raised at yesterdays telcon.
>
> It might be worth keeping in mind that that OpenVG specification [1] in
> Section 6.4 specifies that the pixel (x, y) has its center at the point
> (x + 0.5, y + 0.5) - i.e. 0,0 is the bottom left of the bottom left.
>
> Given the choice of the different variations out there, I'd prefer to go
> with Alex's assumption and say that 0,0 should be the top left of the
> top left.


For reference, here is the email Alex Danilo wrote me on the topic:

-------- Original Message --------
Subject: Re: [Fwd: Re: svg pixel coverage rule]
Date: Wed, 29 Jul 2009 15:53:06 +1000
From: Alex Danilo <alex@abbra.com>
To: Doug Schepers <schepers@w3.org>

Hi Doug,

 Well, all the SVG spec. has said for years is that the rendering
will be conformant if the visual result is within 1 pixel of the expected
rendering.

 But of course that doesn't say anything about pixel centre, edge,
etc.

 It does matter though - and calculating pixel coverage is
even harder when antialiasing comes into it!

 I've assumed top/left of the pixel is where the co-ordinates
are based, i.e if you say 0,0 on a 1:1 user->device mapping then that
position is the top-left of the pixel at the top left corner of the
device window.

 Ages ago I did a sub-pixel test that draws a diamond that spans
one scanline and 2 or 3 pixels horizontally (can't remember 2 or 3) and
ran it against _lots_ of implementations.

 They're pretty consistent in having the corner of the pixel
being the positioning - I didn't see any that assumed pixel centre
although that does happen in other graphics libraries.

 Calculating the exact expected hex values for the pixels
can easily be done using geometry to give the expected values (which
are the same as geometric coverage).

 The result of that test was that all the implementations differ
and only one (guess who:-) gets the correct value for the theoretical
coverage. The difference in the results is astounding - and ASV was one
of the worst performers even though they look pretty good on most images.

 In any case, the real answer is that the co-ordinate system
is based on pixel corners, not centres, and that the results of
anti-aliasing produce varying results - but a conformant implementation
will color the pixels within 1 pixel of the expected theoretical
coverage.

Cheers,
Alex

Received on Thursday, 13 August 2009 04:17:44 UTC