W3C home > Mailing lists > Public > www-svg@w3.org > December 2008

Antialiasing and adjacent shapes

From: Johannes Rössel <johannes.roessel@uni-rostock.de>
Date: Fri, 26 Dec 2008 11:51:38 +0100
To: www-svg@w3.org
Message-ID: <4954B73A.1050305@uni-rostock.de>


is there any part of the SVG specification that governs how things like

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
   <g fill="#000" stroke="none">
       <rect x="10" y="10" width="10" height="10"/>
       <rect x="20" y="10" width="10" height="10"/>
       <rect x="10" y="20" width="10" height="10"/>
       <rect x="20" y="20" width="10" height="10"/>

       <rect x="70" y="70" width="20" height="20"/>
   </g>       </svg>

should be rendered? I. e. where shapes are exactly adjacent to each other.

Intuitively I'd say both visible squares (of 20 px edge length) should 
look exactly the same, but in fact seemingly due to antialiasing 
(shape-rendering='crispEdges' seems to help in FF and WebKit, though not 
in Inkscape) there are lines introduced within the shape. Collapsing 
adjacent shapes into a single path would work as well but this is 
sometimes cumbersome for automatically generating SVG files.

See http://hypftier.de/temp/svg_adjacent_shapes.png for an image example.

I see this phenomenon as an unwanted side-effect and setting 
shape-rendering to crispEdges only helps with shapes that only have 
horizontal or vertical edges.

Or is there another method to suppress this I haven't found yet?

Johannes Rössel
Received on Friday, 26 December 2008 14:05:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:21 UTC