resvg ![Build Status]

resvg is an SVG rendering library.

It can be used: - As Rust library. - As C library (see capi). - As CLI application (see tools/rendersvg).

Purpose

resvg can be used to render SVG files based on a static SVG Full 1.1 subset, excluding fonts support. In simple terms: no animations, scripting and embedded fonts.

The core idea is to make a fast, portable, small, multiple backend library designed for edge-cases.

It can be used as a simple SVG to PNG converter and as an embeddable library to paint SVG on an application native canvas.

Why a new library?

resvg is trying to compete with [librsvg], [QtSvg] and [Inkscape] (only as a CLI SVG to PNG converter).

One of the main difference from other rendering libraries is that resvg does a lot of preprocessing before rendering. It converts shapes to paths, resolves attributes, removes groups, removes invisible elements, fixes a lot of issues in malformed SVG files and only then starts the rendering. So it's very easy to implement a new rendering backend.

More details here.

resvg vs librsvg

librsvg is the main competitor to the resvg. And even though that librsvg itself is being rewritten in Rust, as resvg, the architecture of the library is completely different:

resvg vs Inkscape

Inkscape is often used to convert SVG to PNG, but it's not an actual competitor to resvg, because it's still a complete SVG editor, not a tiny library. Also, it's very slow. But it has the best SVG support amongst other.

resvg vs QtSvg

Without a doubt, [QtSvg] is heavily used in [Qt] applications. But [QtSvg] itself is very limited. It officially supports only a tiny portion of the SVG Tiny 1.2 subset. In simple terms - it correctly renders only primitive SVG images.

SVG support

Results of the static subset of the SVG test suite:

Chart1

Results of the resvg test suite:

Chart2

You can find a complete table of supported features here. It also includes alternative libraries.

TL;DR

Performance

Chart3

Backends

resvg supports [Qt] and [cairo] backends.

Project structure

All other dependencies aren't written by me for this project.

Build

See doc/build.md for details.

License

resvg is licensed under the MPLv2.0.