View on GitHub

Canvas-Graphics

Creating SVG from a bitmap source

Primitive

The idea behind this is

This implementation is based on the Javascript port, originally.

How it works

It tries to find a shape that increases the similarity of the target to the original image one shape at the time. The result is a reproduction of the original image using basic shapes.

The SVG output is optimized for size, but it depends directly on the shape count. 10 shapes result in less then 1kb. With an blur the result gives a good impression of the actual image.

Shape Examples

Triangle

Rectangle

Rotated Rectangle

Ellipse