Niko,

Thanks for taking the time to provide more explanation. It seems all the program I was able to find converting png to svg using vector pixels are doing it wrong.
I am unsure adding a thin stroke will fix the issue but I am thinking of an other approach:

Convert all PNG pixels to SVG rects. Each rect would be 1.5 wide but each rect would be positioned 1 apart from each others. This way there would be no gap ever. The last line and last column of rects would of course be 1 wide instead of 1.5.

Can you think of a better approach ?

FabienĀ 

On Mon, Sep 22, 2014 at 1:27 PM, Niko Kiirala <niko@...1267...> wrote:
Mon, 22 Sep 2014 10:00:14 -0700
Fabien Sanglard <fabiensanglard.net@...400...> kirjoitti:

> >
> > It's an aliasing issue.
>
>
> I thought it was a floating point accuracy issue ? Can you elaborate
> on this so I can understand the issue better ?

It is an issue of antialiasing combined with simple blending model.

Consider a pixel that is exactly divided in half by two polygon:
polygon A fills the left side of the pixel, polygon B the right side.

Antialiasing tells us that each polygon on its own has a coverage of
0.5 (or 50 %) in that pixel. This far everything is correct.

Inkscape then uses simple alpha blending to combine the colour
contribution from those two polygons to create the pixel colour. The
blending stage does not know the shape of the two polygons, just that
each would fill half of the pixel on its own.

The blending equations make the assumption that the two polygons are
orthogonal to each other (say, A filling the left half and B filling
the top half), which usually works well, but is bad in this exact
corner case. So, the final coverage of the pixel becomes
coverage(A)+coverage(B)*(1-coverage(a)) = 0.5 + 0.5*0.5 = 0.75.

So, instead of getting fully opaque pixel, we get 25 % transparent one.
Rendered on top of white background, the pixel becomes considerably
lighter than it should have been.

--
Niko Kiirala
niko@...1267...