CLI tool
linebender/resvg avatar
linebender/resvg

resvg renders static SVG only, and it will never animate or run a script

An SVG rendering library.

4,213 stars396 forksRustApache-2.0

At a glance

What is it?
linebender/resvg is a pure Rust SVG renderer for Rust, C and the command line. It trades animation, scripting and native text for pixel-identical output on every platform.
Who is it for?
Choose resvg when you convert user-supplied or untrusted SVG to PNG and need the same pixels on every machine. Skip it for animated or scripted SVG, SVG Tiny 1.2, or any pipeline that expects native OS text.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • linebender/resvg4,213 ★ · +101
Star history
Repository2026-10-082026-11-23
linebender/resvg4.1k4.2k

101 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Animations and scripts are cut from the scope on purpose

resvg targets only the static subset of SVG. That means no a, script, view or cursor elements, no events and no animations. The project states that it has no plans to implement animation, so a file that depends on motion or on JavaScript is outside what resvg will ever handle.

The practical consequence is a split in who should reach for it. If you are rasterising icons, logos, charts or illustrations to PNG, static is all you need. If you are previewing SVGs that behave like small web pages, you need a browser, and resvg cannot stand in for one. The project is blunt about this tradeoff: browsers support dynamic SVG features that resvg does not, but it argues that using a browser to render SVG correctly is not an option either, because even browsers fail parts of the specification.

SVG Tiny 1.2 is a separate case. It is not supported and support is not planned, so files authored for that profile need another renderer.

Text is drawn without the operating system's text engine

resvg does not rely on any system libraries, and that rules out native text rendering. The project's argument is that native text rendering is tuned for small horizontal text, which is not what most SVG contains.

Two more text constraints sit in the limitations list. Only UTF-8 is accepted, so a text file in another encoding is out of scope, and the project dismisses legacy encodings as no longer relevant. And because fonts are loaded without the platform's help, system font loading is the area where the project admits rough edges on mobile operating systems and obscure CPU architectures.

If your SVGs reference fonts by name and you deploy to a phone or an unusual target, test font discovery first, since system font loading is exactly where resvg lists its rough edges.

usvg parses, resvg paints, and you can replace the second half

Parsing and rendering are two completely separate steps in this project, and each lives in its own library. usvg handles the SVG side and resvg handles painting. The workspace in Cargo.toml lists four members: crates/c-api, crates/resvg, crates/usvg and crates/usvg/codegen. The default member is crates/resvg, which is the CLI and library, while a tools/explorer-thumbnailer entry sits commented out.

The split matters if you already have a 2D drawing library. You can depend on usvg alone, take its simplified tree, and write your own renderer on top using any 2D library you like. Drawing inside resvg itself goes through tiny-skia, which is a separate repository under the same linebender organisation.

The cost is that you take on the renderer's job. usvg gives you a processed tree, not pixels, and every filter, gradient and clip you need becomes your responsibility to draw.

Everything in the final binary is Rust, with unsafe confined to dependencies and font mapping

resvg describes itself as the only Rust SVG library written completely in Rust, with no non-Rust code in the final binary. It handles more than SVG and XML: CSS, TTF, PNG, JPEG, GIF and GZIP all pass through it, which is why the safety claim covers a wide input surface.

The project's own code has almost no unsafe. Two exceptions are named: some dependencies contain unsafe code, and font memory-mapping is inherently unsafe. The authors call the result the best you can get in terms of memory safety, which is a narrower claim than none.

Beyond memory safety, resvg has extensive checks to prevent endless loops (freezes) and stack overflows from recursion. Both are failures a malicious or broken file can trigger. The checks are described but their limits are not published, so a service rendering untrusted uploads should still enforce its own timeout and memory cap.

The CLI is under 5MB and needs no external dependencies, since the binary contains only what rendering SVG requires.

Pixel-identical output holds because nothing is borrowed from the host

Reproducibility follows directly from the no-system-libraries rule. Render an SVG on x86 Windows and again on ARM macOS and the produced image is identical, down to every pixel value. Snapshot tests, cached thumbnails and build pipelines that compare image hashes all benefit.

That guarantee is conditional on the same inputs. It is a statement about the renderer's own arithmetic, so a different font set or a different resvg version can still change the output. The release history shows how quickly versions move: v0.48.0 and v0.48.1 both landed on 2026-08-02, and v0.49.0 followed on 2026-10-24. Pin the version in any pipeline whose hashes you store.

The project makes no performance claim with a number. It says only that, because it is written in Rust and renders through tiny-skia, it is pretty fast, with room for improvement, and it declines to compare speed across libraries because feature sets and build flags differ too much.

The 1600-test suite is public, and some rivals are left off the table

resvg ships around 1600 SVG-to-PNG regression tests, not counting tests inside its dependencies. The suite is published separately as resvg-test-suite and is not tied to resvg in any way, so anyone writing their own SVG library can run it.

The suite produces a support table that includes some alternative libraries. Three are named as failing the 25% mark and therefore omitted: wxSvg, LunaSVG and nanosvg. The project's stated reason is that many SVG libraries are pretty bad. That is the authors' judgment, and the pass-rate table is the evidence to check it against, so open it before choosing between resvg and another renderer.

SVG 2 support is in progress. Open work is tracked under the svg2 label in the issue tracker and in docs/svg2-changelog.md. If your files use SVG 2 features, check that changelog for the specific feature before assuming it renders.

Three entry points, no install command to copy

resvg can be used as a Rust library, as a C library through crates/c-api, and as a CLI application for rendering static SVG files. The crate is published on crates.io with documentation on docs.rs. Rust users add the crate as a dependency, and the CLI comes from the default workspace member crates/resvg.

The repository does not give a copy-paste install line for any of the three, so there is no command to quote here. Build details are limited to what Cargo.toml defines: a production profile that inherits release with opt-level 3, lto enabled, codegen-units 1, strip enabled, debug off and incremental off. Those settings are the ones Cargo.toml applies when you build with --profile production.

The project is not archived. The last push was 2026-10-24 and the license is Apache-2.0, with the README offering a dual choice of Apache-2.0 or MIT. Contributions arrive by pull request and the Rust code of conduct applies.

Editorial conclusion

Choose resvg when you convert user-supplied or untrusted SVG to PNG and need the same pixels on every machine. Skip it for animated or scripted SVG, SVG Tiny 1.2, or any pipeline that expects native OS text. Before adopting it, run your own fonts and your hardest files through the CLI, because text loading is where the project admits rough edges.

Frequently asked questions

How do I use resvg?

resvg can be used as a Rust library, as a C library, or as a CLI application that renders static SVG files. It parses with usvg and paints with tiny-skia, and it is meant for static SVG only.

How do I install resvg?

The repository gives no install command. The crate is published on crates.io, documented on docs.rs, and the default workspace member crates/resvg is the CLI and library.

How does resvg compare with librsvg?

The repository does not compare resvg with librsvg. Its comparison is a support table from the resvg test suite that includes some alternative libraries, and it names wxSvg, LunaSVG and nanosvg as omitted for falling under 25%.

How does resvg compare with sharp?

The repository does not mention sharp. It says resvg is written completely in Rust with no non-Rust code in the final binary and does not rely on system libraries.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. linebender/resvg on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/linebender-resvg.svg)](https://hysenlabs.com/projects/linebender-resvg)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/linebender-resvg.svg)](https://hysenlabs.com/projects/linebender-resvg)

Was this useful?