The resvg is a command-line tool that converts SVG vector graphics into raster image formats such as PNG. It is built in Rust and focuses on accurate rendering while maintaining excellent performance. This tutorial demonstrates how to install resvg on Ubuntu 26.04.
Install resvg
Download the latest release archive from the official GitHub repository and extract the executable into a directory included in the system PATH:
curl -sSL https://github.com/linebender/resvg/releases/latest/download/resvg-linux-x86_64.tar.gz \
| sudo tar xz -C /usr/local/bin resvg
Confirm that the installation completed successfully by checking the resvg version:
resvg --version
Testing resvg
Create a simple SVG file for testing:
nano test.svg
Add the following content into the file:
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="orange"/>
</svg>
Render the SVG image into a PNG file with the following command:
resvg test.svg test.png
After the command finishes, the generated test.png image should appear in the current working directory.
Uninstall resvg
To remove resvg from the system, delete the installed executable:
sudo rm -rf /usr/local/bin/resvg
Leave a Comment
Cancel reply