Skip to content
CAI
Software that uses CAICheck a score

linebender/resvg

63.1

Adequate · 30 September 2026

21.7k

lines of production code

Rust

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

resvg is a Rust library that parses SVG documents and renders them to bitmap images, featuring a rewritten engine for improved correctness and performance. It supports complex SVG features including advanced filters, variable fonts, and multiple image formats, while exposing a C API for integration with C and C++ applications. The system also includes utilities for generating Windows Explorer thumbnails and viewing SVGs locally.

How it got here

2017 — resvg workspace restructuring

19 changes.

The project was renamed to resvg and restructured into a multi-crate workspace, migrating to Rust 2024 and modernizing dependencies. Legacy components, including the old C-API, Qt and Cairo backends, and associated demo applications, were removed to streamline the codebase.

2019–2023 — Rendering engine rewrite and C API expansion

11 changes.

This period focused on a complete rewrite of the SVG rendering engine to improve correctness, performance, and support for complex features like filters, masks, and WebP images. The project expanded its ecosystem by introducing a new C API with Qt bindings, an Explorer thumbnailer for Windows, and simplified utility tools, while also dual-licensing the core crates under Apache-2.0 or MIT.

2024 — SVG parser and text rendering overhaul

5 changes.

The usvg crate underwent a comprehensive restructuring, replacing manual maintenance with automated code generation and refactoring the parser into modular components. This period focused on rewriting the text rendering engine to leverage harfbuzz and fontations, enabling support for variable fonts and COLRv1 color fonts while fixing various calculation bugs.

Features

Add SVG rendering examples and demonstrate custom image resolution

The examples directory now includes runnable demonstrations for basic SVG rendering (minimal.rs), visualizing element bounding boxes (draw\_bboxes.rs with bboxes.svg), and implementing a custom image href resolver (custom\_href\_resolver.rs with custom\_href\_resolver.svg). These examples show users how to load SVGs, configure options like system font loading and resource directories, render to bitmaps, and handle external image references via custom resolvers.

crates/resvg/examples · high confidence

Initial release of resvg Explorer Extension for SVG thumbnails

This change introduces the \tools/explorer-thumbnailer\ component, a new Windows Shell Extension that enables Windows File Explorer to display thumbnail previews for SVG files. The tool is a complete rewrite in Rust, implementing the \IThumbnailProvider\ COM interface to parse SVGs using \resvg\ and render them into bitmaps. It includes an Inno Setup installer (\installer.iss\) for registering the extension and handling registry keys, and is dual-licensed under Apache-2.0 OR MIT.

tools/explorer-thumbnailer · high confidence

Initial release of the resvg C API and Qt bindings

This change introduces the C API for resvg, providing C bindings (lib.rs, resvg.h) and a Qt wrapper (ResvgQt.h) that allow C and C++ applications to parse and render SVG images. The API exposes options for configuring DPI, fonts, stylesheets, and resource directories, and includes an example for rendering to Cairo contexts. The library is licensed under Apache-2.0 OR MIT.

crates/c-api · high confidence

New SVG filter primitives implementation

The \resvg\ crate now includes a complete set of new filter implementations for SVG effects, including box blur, IIR blur, color matrix, component transfer, composite, convolve matrix, displacement map, lighting (diffuse and specular), morphology, and turbulence. This adds support for rendering complex visual effects defined by SVG filter primitives directly within the library.

crates/resvg/src/filter · high confidence

Removals

C-API module removed

The C-API implementation located in capi/src/lib.rs has been deleted, removing the associated bindings and rendering functions (such as resvg\_parse\_doc\_from\_file, resvg\_qt\_render\_to\_canvas, and resvg\_cairo\_render\_to\_canvas) from the public interface.

capi/src · high confidence

Removal of Cairo rendering backend implementation

The Cairo rendering backend implementation located in \src/render\_cairo\ has been completely removed. This deletes the entire module, including the main rendering logic (\mod.rs\), path drawing (\path.rs\), text rendering (\text.rs\), image handling (\image.rs\), gradient and fill/stroke application (\gradient.rs\, \fill.rs\, \stroke.rs\), and Cairo context extension traits (\ext.rs\). Users relying on this specific backend will no longer have access to these rendering capabilities.

_src/render\cairo · high confidence

Removal of GTK-based Cairo rendering example

The GTK-based example application for rendering SVGs via the Cairo backend has been removed from the examples directory. This change eliminates the specific UI implementation that previously demonstrated how to integrate resvg with GTK drawing areas, meaning users can no longer run this standalone example to see Cairo rendering in a GTK window.

examples/cairo-rs · high confidence

Removal of legacy libresvg documentation and support charts

The documentation for the legacy libresvg project has been removed, including the build instructions (doc/build.md), the SVG document structure guide (doc/svgdom.adoc), the feature support table (doc/support-table.adoc), and the HTML-based support comparison charts (doc/support-chart.html, doc/support-table-checked.html). This cleanup reflects the project's transition to the resvg architecture, where the preprocessor and tree logic were moved to the usvg crate and tests were relocated to the resvg-test-suite repository.

doc · high confidence

Removal of legacy src modules (error, lib, math, options, render\_utils, traits)

The internal implementation files \src/error.rs\, \src/lib.rs\, \src/math.rs\, \src/options.rs\, \src/render\_utils.rs\, and \src/traits.rs\ have been deleted. This removes the library's previous public API surface, error handling via \error\_chain\, geometric primitives (\Rect\, \Point\, \Line\), rendering options (\Options\, \FitTo\), and attribute access traits, indicating a significant structural change or migration of these components to other parts of the codebase.

src · high confidence

Removal of the Qt rendering backend

The entire Qt-based SVG rendering implementation has been removed from the product. This change deletes the \src/render\_qt\ module and all its constituent files (\ext.rs\, \fill.rs\, \gradient.rs\, \image.rs\, \mod.rs\, \path.rs\, \stroke.rs\, \text.rs\), eliminating the ability to render SVG documents to images using the Qt framework.

_src/render\qt · high confidence

Removal of the rendersvg tool

The \tools/rendersvg\ directory, including its source code, build configuration, and documentation, has been removed from the repository. This eliminates the standalone command-line utility that previously rendered SVG files to PNG using either a Cairo or Qt backend.

tools/rendersvg · high confidence

Removed GTK-based C and Rust examples

The GTK-based example applications for the C API (cairo-capi) and the Rust API (cairo-rs) have been removed. Users can no longer run these specific GTK integration demos, which previously demonstrated how to render SVGs using the Cairo backend within GTK windows.

examples · high confidence

Removed Qt-based SVG demo application

The \demo\ directory, which contained a Qt-based application for rendering SVG files using the \resvg\ C-API, has been removed. This includes the deletion of the \Ghostscript\_Tiger.svg\ sample asset, the \README.md\ documentation, the Qt resource file (\resources.qrc\), and the C++ source files (\svgview.cpp\, \svgview.h\) that implemented the SVG viewing widget.

demo · high confidence

Removed legacy DOM implementation in favor of svgdom

The custom \src/dom\ module, which previously handled SVG document structures and conversion logic, has been completely removed. This eliminates the internal representation of SVG elements, attributes, and gradients that were manually mapped to the \svgdom\ library, indicating a shift to rely directly on the \svgdom\ crate for DOM handling.

src/dom · high confidence

Removed regression test infrastructure

The regression testing suite located in tests/regression has been removed. This included the deletion of the allowlist file (allow.txt) and the main test runner source code (src/main.rs), which previously handled SVG rendering comparisons against previous git commits using the libresvg/rendersvg toolchain.

tests/regression · high confidence

Removed statsgen test suite and generation scripts

The \tests/statsgen\ directory has been removed, deleting the \statsgen.py\ script, \style.css\, \README.md\, and \local\_tests.csv\. This eliminates the tooling and data used to generate HTML reports from SVG test suite results, effectively removing this specific test coverage generation capability from the project.

tests/statsgen · high confidence

Removed vdiff visual diff test tool

The vdiff visual diff tool located in tests/vdiff has been removed. This included the deletion of the Qt-based application source code (main window, image view, rendering logic), UI definitions, and supporting headers, along with the project build file (vdiff.pro) and associated documentation (README, LICENSE).

tests/vdiff · high confidence

SVG preprocessing module removed

The entire \src/preproc\ module has been deleted, removing the code responsible for preprocessing SVG documents. This includes unit conversion, font-size resolution, gradient and pattern attribute resolution, inheritance handling, and the flattening of structural elements like \\<use\>\, \\<a\>\, \\<g\>\, and \\<switch\>\.

src/preproc · high confidence

Behavioural changes

Complete SVG rendering engine rewrite with new clipping, masking, and image handling

The resvg rendering engine has been completely rewritten to improve correctness and performance. The new implementation introduces dedicated modules for handling SVG clip paths and masks, ensuring nested clipping and complex mask interactions are rendered accurately. Image support has been expanded to include WebP decoding alongside existing JPEG, PNG, and GIF formats, with configurable rendering modes (e.g., pixelated, smooth). The renderer now uses pre-calculated bounding boxes and layer isolation to optimize filter application and prevent performance issues with large filter regions, while also fixing previous issues with canvas clipping and filter region calculations.

crates/resvg/src · high confidence

New internal SVG tree parser implementation

The \usvg\ crate now uses a newly introduced internal SVG tree parser located in \crates/usvg/src/parser/svgtree\. This change replaces the previous parsing logic with a new \Document\ structure that builds an in-memory tree of elements and text nodes, supporting features such as stylesheet injection, \!important\ CSS handling, and specific attribute precedence rules (e.g., \href\ over \xlink:href\). The new parser also handles text node trimming according to SVG whitespace specifications and supports variable fonts and additional image rendering attributes.

crates/usvg/src/parser/svgtree · high confidence

Port text rendering to harfbuzz and fontations with COLRv1 support

The text rendering engine has been rewritten to use the harfbuzz shaping library and the fontations font backend (via skrifa), replacing the previous implementation. This change introduces support for variable fonts, COLRv1 color fonts, and bitmap glyphs (sbix/CBDT), while also adding best-effort SVG output for COLR glyphs. The new architecture separates text layout from outlining, improves glyph advance calculations, and correctly handles text node absolute transforms and optical sizing (opsz) variations.

crates/usvg/src/text · high confidence

Project renamed to resvg and relicensed to Apache-2.0/MIT

The project has been renamed from 'libresvg' to 'resvg' and its license has changed from MPL-2.0 to the dual Apache-2.0/MIT license. This update also includes a new README that reflects the new name, updated build status badges, and a lower Minimum Supported Rust Version (MSRV) of 1.85.0.

(repo-wide) · high confidence

Removal of legacy C-API header (resvg.h)

The legacy C-API header file \resvg.h\ has been removed from the \capi/include\ directory. This file previously exposed functions for parsing SVG documents from files or data, retrieving image sizes, and rendering to Cairo or Qt backends. Users relying on this specific header for C/C++ integration will need to update to the new API structure provided by the C-API rewrite.

capi/include · high confidence

Resvg crate re-licensed under Apache-2.0 OR MIT

The resvg crate now offers dual licensing under the Apache-2.0 and MIT licenses, providing users with more flexible options for usage and distribution. This change adds the standard license texts for both Apache-2.0 and MIT to the crate directory, allowing developers to choose the license that best fits their project requirements.

crates/resvg · high confidence

SVG attribute and element parsing code generation

The usvg crate now uses an automated code generation process to define the enums and lookup maps for SVG elements and attributes. A new codegen tool reads lists of supported elements and attributes (including \background-color\ and variable font settings) from text files and generates the corresponding Rust source code, replacing manual maintenance with a data-driven approach.

crates/usvg/codegen · high confidence

SVG conversion logic removed from src/convert

The SVG-to-internal-structure conversion logic located in src/convert (including fill, stroke, gradient, image, path, shapes, and text modules) has been deleted. This change removes the code responsible for parsing SVG DOM nodes and translating them into the library's internal representation, indicating that this conversion functionality has been moved or refactored into other parts of the codebase.

src/convert · high confidence

SVG parser refactored into modular components with new image and font resolution APIs

The SVG parsing logic in the usvg crate has been restructured into distinct modules (clippath, converter, filter, image, marker, mask, paint\_server, shapes, etc.) to improve maintainability and separation of concerns. This change introduces a new \ImageHrefResolver\ API that allows users to customize how \\<image\>\ elements load data (e.g., supporting WebP, nested SVGs, or custom URL handlers) and adds support for user-provided font loading callbacks via \FontResolver\. Additionally, the parser now handles variable fonts, context-fill/stroke, and 2-point conical radial gradients, while fixing several bounding box and transform calculation bugs.

crates/usvg/src/parser · high confidence

SVG tree model refactored with new geometry, text, and filter primitives

The internal SVG tree representation has been restructured into dedicated modules for geometry, text, and filters. This introduces a new \ViewBox\ type with a \to\_transform\ method for coordinate conversion, a \BBox\ calculator for bounding box operations, and a \Font\ struct that supports variable font variations. Filter definitions are now modeled with explicit \Primitive\ and \Kind\ enums, and text rendering now utilizes distinct \TextRendering\ and \ImageRendering\ enums to control output quality.

crates/usvg/src/tree · high confidence

Simplified viewsvg tool with new UI controls and build configuration

The viewsvg tool has been restructured from the previous demo location, replacing the old 'Render to' and zoom controls with a simplified interface featuring 'Size' (Original/Fit to View) and 'Background' (None/White/Check board) options. The application now loads SVG files via command-line arguments instead of embedding a default resource, and the build system has been updated to link against the relocated C-API library and include Windows-specific system libraries.

tools/viewsvg · high confidence

usvg crate relicense to Apache-2.0 OR MIT

The usvg crate is now dual-licensed under the Apache-2.0 and MIT licenses, providing users with greater flexibility in how they incorporate the library into their projects. This change adds the standard LICENSE-APACHE and LICENSE-MIT files to the crate root and updates the README to reflect the new licensing terms.

crates/usvg · high confidence

usvg crate restructured with new CLI and write options

The usvg library has been restructured into a single crate, introducing a new command-line interface (main.rs) with options for font loading, text preservation, and rendering hints, alongside a refactored writer module (writer.rs) that exposes WriteOptions for controlling SVG output formatting such as indentation, precision, and ID prefixes.

crates/usvg/src · high confidence

Test coverage

Added parser and write regression tests for usvg; Added regression tests and test fonts for resvg; Removed SVG and PNG test assets.

Dependencies

Migrate to Rust 2024 edition and restructure into a multi-crate workspace

The project has been restructured from a single crate into a workspace containing \resvg\, \usvg\, and \resvg-capi\, with the minimum supported Rust version (MSRV) raised to 1.85.0 and the edition updated to 2024. This change introduces a new \production\ build profile for optimized binaries and replaces legacy dependencies (such as \svgdom\, \libflate\, and \error-chain\) with modern alternatives like \usvg\, \svgtypes\, \flate2\, and \pico-args\. The C API is now a dedicated crate (\resvg-capi\) with explicit feature flags for text, fonts, and image support, while older backends and tools like \rendersvg\ and the Cairo example have been removed.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 63 → 63 (-0.0)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 78 → 78 (-0.3)
  • Architecture 100 → 95 (-4.6)
  • Maturity 59 → 59 (+0.3)
  • Readiness 55 → 55 (+0.5)
  • Security 73 → 79 (+5.3)

Resolved (4)

  • Hotspot: crates/resvg/src/filter/mod.rs (crates/resvg/src/filter/mod.rs)
  • Hotspot: crates/usvg/src/parser/converter.rs (crates/usvg/src/parser/converter.rs)
  • Hotspot: crates/usvg/src/parser/use_node.rs (crates/usvg/src/parser/use_node.rs)
  • Hotspot: crates/usvg/src/tree/mod.rs (crates/usvg/src/tree/mod.rs)

New (11)

  • Ambiguous duplication: It is unclear what the semantic difference between from_data and from_data_nested is. Without documentation, these appear to be redundant entry points for the same operation (parsing SVG from bytes), potentially causing confusion about when to use which.
  • Documentation: no licence statement (README.md)
  • Documentation: no project overview (README.md)
  • Inconsistent naming convention for bounding box variants: Node exposes abs_layer_bounding_box (returning NonZeroRect), while Group exposes layer_bounding_box (returning NonZeroRect) and abs_layer_bounding_box. The prefix abs_ is used for absolute transforms, but the presence of layer_ vs non-layer variants is inconsistent across Node and Group (e.g., Node has abs_layer_bounding_box but no layer_bounding_box, whereas Group has both). This suggests a potential API gap or inconsistency in what bounding box types are exposed per node type.
  • Inverted test pyramid
  • Off the main sequence: usvg
  • Outdated: base64
  • Outdated: flate2
  • Outdated: log
  • Outdated: siphasher
  • Projects may be oversized for their cohesion

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • crates/resvg — 1 commit

Notable commits

  • change: tests: load test fonts in a deterministic order (#1136)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

linebender/resvg was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 75b6bbadd7999d0516dcd7153b4a321bfdf8670a — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-cb25ca4feafa.