Li et al. (2020) | Differentiable Vector Graphics Rasterization for Editing and Learning (diffvg)

Li et al. introduce a differentiable renderer for vector graphics, such as SVG. This renderer bridges the raster and vector domains through backpropagation and allows for losses in the “raster space” to be propagated back into the “SVG space”.

diffvg paper

Fig. 47 Screenshot of the diffvg paper

Visual results

diffvg paper - stylized results

Fig. 48 Screenshot of the visual results taken from the diffvg paper

Covered elements and attributes

The differentiable renderer is able to deal with the following elements and attributes.

Elements

The diffvg primitives are based on the SVG (Scalable Vector Graphics) standard. diffvg supports SVG paths (with linear, quadratic or cubic segments), ellipses, circles, and rectangles, but any curve with a parametric form is compatible with our method. The curves can be either open or closed.

  • polynomial and rational polynomial curves, including polygons, quadratic and cubic Bézier curves, circles and ellipses

The current implementation converts arcs to cubic curves.

Attributes

  • stroke color

  • fill color

Colors can be solid, linear gradient, or radial gradient, and contain RGB and alpha channels. The current implementation assumes round caps for the strokes.