RSS Feed for This PostCurrent Article

A Simple SVG Viewer

The SVG viewer is just another example of using Anti-Grain Geometry. AGG is a vector graphics renderer for C++. See Main Page for details. The viewer supports absolute minimum of the SVG specification, it basically can be used as a simple example of AGG plus SVG. But of course, its functionality can be extended. The main point of the viewer is high quality and high performance. The Anti-Aliasing algorithm produces 256 levels of transparency. Actually, AGG computes the exact coverage of the outline on each pixel cell.


Besides, the viewer has a very nice feature that I haven’t seen in any other ones. It’s eliminating of the "problem of adjacent edges". It appears when rendering adjacent polygons with anti-aliasing and looks like thin "web" upon the image. Strictly speaking, it’s possible to get rid of it completely only when the polygons are fully opaque. When they are translucent, the effect will appear anyway. However, it’s possible to reduce the effect so that it becomes almost invisible.

In the AGG SVG Viewer you can control this problem changing the Anti-Aliasing gamma (see Gamma Correction) and the value of dilation of the polygons. Anti-Grain Geometry provides a simple “contour” tool that can dilate or shrink the polygons. This tool can also be used to change the font weight on the fly, for example. The following picture illustrates the result of eliminating the adjacent edges problem.

Trackback URL

RSS Feed for This PostPost a Comment

Refresh Image