On 2012-03-04 3:19, Stefan de Konink wrote:
I wonder:
- is it possible with one extra interpolation step to get a more
visually attractive curve?
We have to deal with displays that have a rather limited resolution, so to some degree artifacts like this simply cannot be helped. However, you are absolutely right that there are different ways of anti-aliasing and some might appear to give a better result in this case. What Inkscape (Cairo) does is just based on coverage of the pixel. For vector images this is one of the best "defaults" (if not the best), as it can lead to reasonable results without any blurring or ringing artifacts (not to mention it's fast). So I would not suggest changing this. (Although in the future it might make sense to have some alternatives as well, for artistic purposes, although we would need Cairo to adopt them.)
What we could try is implementing support for the linearRGB color space. The rationale behind this is that we would like a pixel that is half covered to have a color halfway between the foreground and background, in terms of the actual color shown on screen (or print or whatever). To accomplish this we need to work in a colorspace that is (roughly) linear (like linearRGB). I have attached a slightly fudged example to this mail (the technique is probably similar to the "gamma-corrected" example in the directory you linked to, except that here the colors aren't changed, only the anti-aliasing is changed). One problem with this is that you really want to work with a higher bit depth. Also, this technique is not so easy to apply to existing images, as coverage and opacity are handled in the same way (using the alpha channel).
- the faq mentions that pixel alignment is important, does this mean
that the controlpoints, in all cases, must snap to the raster? [my own results with snapping are virtually the same]
This is most visible with straight lines. Just draw a straight (horizontal or vertical) line with stroke width 1, such that its nodes lie exactly on pixel centers (0.5,0.5 is a pixel center for example). The line should then be exactly one pixel thick. If you draw it with the node on a pixel boundary (like 1,1), the line should be two pixels thick, but with lower opacity.
In short: you're running into fundamental issues that are non-trivial to solve. In the near term, just apply a slight blur to your image if you have problems with Inkscape's anti-aliasing, in the long-term there are some options available to us, but changing the (default) anti-aliasing kernel is probably the last thing we want to do.