OXVG is the fastest1 SVG toolchain for optimisation, linting, transformation, and manipulation. Usable via CLI and libraries for Node, WASM, or Rust.
Install OXVG using the package manger of your choice.
cargo install oxvgbrew install oxvgoxvg --helpoxvg optimise < input.svg > output.svgThe following tools are available in a CLI binary.
Tip
You can try out the OXVG optimiser right in your browser using OXVGUI, a simple web-based playground built by Jonas Geiler (@jonasgeiler).
An SVG optimiser similar to SVGO is available. It can run up to 50x faster, especially on larger file-sets.
We based the optimiser on SVGO and aim for compatibility with it, but it isn't a 1-for-1 replacement. As a result, some plugins may behave differently.
See the SVGO parity guide to understand the differences and instructions for how to migrate your existing configuration.
# or `oxvg optimize`
cat my-file.svg | oxvg optimise > my-file.optimised.svgScreencast.From.2026-08-09.14-54-58.mp4
🤖 Actions (Under Development2)
Actions are a set of commands invoked by a program in order to manipulate an SVG document or pull information from it. It is comparable to Inkscape's actions, but without any dependency on the UI or rendering.
cat overlapping-paths.svg | oxvg action -- -select path -path-intersect > merged-paths.svgOXVG includes a basic linter similar to svglint or vnu to make catching issues in SVG documents much easier. The linter can report SVG issues directly from the command line or through its language-server integration.
# Start language-server
oxvg lint serve
# Report diagnostics to stderr
oxvg lint check w3c/ -r
A JSX transformer to take SVG documents and transform them into JSX components, for use in React, Preact, Native, or any other JSX-compatible language.
This aims to implement SVGR as closely as possible.
cat my-file.svg | oxvg jsx --template template.jsx | prettier > my-file.svg.jsxIf you're a Rust developer wanting to work with SVGs in your project, we have a set of crates at your disposal.
OXVG splits functionality into separate crates that you can use independently according to your project's needs. It offers libraries for DOM parsing and traversal, path handling, optimisation, and manipulation.
Actions are programmatic commands for manipulating and inspecting SVG documents.
This crate provides a set of types that you can use to implement a DOM similar to that of the browser web standards. Though it's not a 1-to-1 match; it's designed for easily traversing and manipulating the DOM.
There's currently an implementation suitable for use with either the xml5ever or the roxmltree parser which can do the following.
- Parse and serialise XML, SVG, and HTML documents
- Commonly used browser API implementations for DOM nodes, elements, attributes, etc.
- An implementation of selectors for using DOM CSS queries
This crate provides types for SVG content.
- Parsing attributes into structured data
- Enumerators for known elements, attributes, and namespaces
This is where you'll find the jobs (i.e. SVGO plugins) for our optimiser, which you can also use as a library in your applications.
This is a library for parsing, optimising, and serialising path definitions (e.g. <path d="..." />).
Please expect some instability as we may add new features to enable simple manipulations for paths in the future.
This is a library for parsing SVG, optimising, and transforming it into JSX modules.
You can build the project for yourself by doing the following
git clone git@github.com:noahbald/oxvg.git
cd oxvg
cargo build --profile release --package oxvg --bin oxvg
# UNIX
./target/release/oxvg --help
# Windows
.\target\release\oxvg.exe --helpOr you can install it through cargo
cargo install oxvg
oxvg --helpYou're welcome to help out and pick up a good first issue or email me to help.
Contributing and architecture guides are available as well.
Thank you to these high quality, open source projects on SVG tooling
- SVGO
- SVGR
- Inkscape
- Linebender
Thank you to these projects for helping make OXVG more popular
- Parcel, for choosing us as a default optimiser
OXVG is open-source and licensed under the MIT License
This project ports or copies code from other open-source (MIT) projects, listed below
- SVGO
- SVGR
- OXC
- Parcel
- Kurbo
Footnotes
-
Fastest I'm aware of; see benchmarks ↩
-
CLI commands under development are safe to use but are either incomplete or likely to experience breaking changes in future. ↩
-
Unstable libraries are either incomplete or likely to experience breaking changes in future. ↩ ↩2