23 releases (breaking)

0.19.0 Oct 4, 2021
0.17.0 Sep 4, 2021
0.15.0 Jun 13, 2021
0.14.0 Mar 9, 2021
0.1.0 Dec 18, 2017

#14 in Graphics APIs

Download history 1093/week @ 2021-07-03 1525/week @ 2021-07-10 2133/week @ 2021-07-17 2219/week @ 2021-07-24 1767/week @ 2021-07-31 3229/week @ 2021-08-07 2210/week @ 2021-08-14 1523/week @ 2021-08-21 1569/week @ 2021-08-28 2757/week @ 2021-09-04 3446/week @ 2021-09-11 2484/week @ 2021-09-18 2659/week @ 2021-09-25 2666/week @ 2021-10-02 3375/week @ 2021-10-09 2943/week @ 2021-10-16

9,494 downloads per month
Used in 45 crates (30 directly)

MPL-2.0 license

8MB
15K SLoC

resvg

Build Status Crates.io Documentation Rust 1.46+

resvg is an SVG rendering library.

Purpose

resvg can be used as a Rust library, a C library and as a CLI application to render SVG files based on a static SVG Full 1.1 subset.

The core idea is to make a fast, small, portable SVG library designed for edge-cases. Right now, a resvg CLI application is less than 3MiB and doesn't require any external dependencies.

Another major difference from other SVG rendering libraries is that resvg does a lot of preprocessing before rendering. It converts an input SVG into a simplified one called Micro SVG and only then it begins rendering. So it's very easy to implement a new rendering backend. But we officially support only one. And you can also access Micro SVG as XML directly via the usvg tool.

SVG support

resvg is aiming to support only the static SVG subset; e.g. no a, script, view or cursor elements, no events and no animations.

SVG 2.0 support is in progress. See #393

SVG Tiny 1.2 is not supported and not planned.

Results of the resvg test suite:

SVG 2 only results:

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

Performance

Comparing performance between different SVG rendering libraries is like comparing apples and oranges. Everyone has a very different set of supported features, implementation languages, build flags, etc. But since resvg is written in Rust and uses tiny-skia for rendering - it's pretty fast.

Safety

resvg and most of its dependencies are pretty safe. The main exception is fonts memory mapping.

License

resvg project is licensed under the MPLv2.0.

Dependencies

~5.5MB
~101K SLoC