SVG shape-rendering Attribute
The shape-rendering attribute hints the renderer about the tradeoff’s to be made while rendering shapes like paths, circles, or rectangles. It has effect only on the following elements: <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect>.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
shape-rendering = auto | optimizeSpeed | crispEdges | geometricPrecision
Attribute Values: The shape-rendering attribute accepts the values mentioned above and described below:
- auto: This value lets the user agent to make automatic decision to balance the speed, have crisp edges or have good geometric precision. When nothing is specified then this value acts as the default value.
- optimizeSpeed:This value lets the user agent to specify that the shape will be rendered in a manner to emphasize speed over geometric precision or crisp edges.
- crispEdges:This value lets the user agent to specify that the shape will be rendered with an emphasis given to the contrast of clean edges over geometric precision or speed.
- geometricPrecision: This value lets the user agent to specify that the shape will be rendered with geometric precision rather than focusing on the speed or crisp edges.
Example 1: Below examples illustrate the use of shape-rendering attribute using geometricPrecision attribute value.
Example 2: Below examples illustrate the use of shape-rendering attribute using crispEdges attribute value.