A fast, portable, and safe SVG rendering library written in Rust, supporting static SVG files.
resvg is a high-performance SVG rendering library written in Rust that converts static SVG files into raster images like PNG. It focuses on correctness, safety, and minimalism, providing a reliable alternative to browser-based rendering for precise, reproducible output. The library supports the full static SVG specification and is designed to handle complex SVG features with extensive testing.
Developers and engineers who need to programmatically render SVG files to raster images in applications such as document generation, image processing pipelines, or server-side graphics. It is particularly suited for those requiring cross-platform consistency, security against malicious input, or embedding in resource-constrained environments.
Developers choose resvg for its emphasis on memory safety through Rust, pixel-perfect reproducibility across platforms, and minimal footprint with no external dependencies. Its modular architecture separates SVG parsing (via usvg) and rendering, allowing customization, while its extensive test suite ensures correctness for edge cases in SVG rendering.
An SVG rendering library.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
With around 1600 SVG-to-PNG regression tests, resvg ensures high correctness across complex SVG features, as highlighted in the README to handle edge cases.
Written entirely in Rust with minimal unsafe code, resvg prevents vulnerabilities from random input including SVG, XML, CSS, and fonts, offering robust security.
The CLI binary is under 3MB with no external dependencies, making it ideal for resource-constrained environments like embedded systems or WASM applications.
Produces identical pixel-perfect results on all supported platforms, from x86 Windows to ARM macOS, without relying on system libraries, ensuring consistency.
resvg explicitly does not support SVG animations and has no plans to implement them, limiting its use for dynamic graphics or interactive visualizations.
It does not use native text rendering, which the README admits might affect optimization for small horizontal text, potentially leading to suboptimal performance in text-heavy SVGs.
Supports only the static SVG subset, meaning no elements like 'a' or 'script', which restricts handling of interactive or linked SVGs common in web contexts.