On 02-10-11 23:49, Florian Berger wrote:
...
I don't see any interpolation artifacts - I do see antialiasing where the "vector pixels" (40x40px) do not fall on pixel grid lines in the exported PNG. [...] AFAIU the "bright grey" (lines) are antialiased edges of the vector squares (against the transparent background), not interpolation errors.
Ok, so it's antialiasing artefacts then. That's what I meant. Anyway, Inkscape could do a better job here. Naively spoken, the renderer should ignore the background if two rectangular shapes are touching.
You are right that Inkscape could do better, but it is not that easy. Basically there are four ways to deal with this issue:
1. Draw shapes as overlapping.
2. Blend using additive blending (currently only possible through filters, but this will change).
3. Create an option to turn off antialiasing.
4. Make Inkscape recognize such "corner" (or rather edge) cases.
The first can obviously be done, but can lead to additional artifacts (although usually much less noticeable). The second should work just fine for cases like this where all shapes are disjoint, but does not produce the desired result in other cases (and at the moment you can only do it through filters, or indirectly through using layers, both not ideal).
The third option is much requested and has its merits. A few weeks ago I started on a patch to implement this (it looks to be quite simple using the new Cairo-based code), but I ran into some issues with properly supporting the required attributes and it needs to be updated. But this will come, eventually. Unfortunately this is obviously just a partial fix for this particular problem.
The fourth option is clearly the best, but this probably isn't coming for quite some time. It is a problem with practically all vector graphics implementations, and although there are some solutions they basically all come down to requiring more memory/cpu, although especially for export this probably would be quite acceptable.
So, you are right that this needs fixing, and it is on the radar, it will just take some time. But feel free to chime in with ideas and/or requests, examples of software that does "do it right", etc.