LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rsvg-convert

Convert SVG images to other formats

TLDR

Convert SVG to PNG
$ rsvg-convert [input.svg] -o [output.png]
copy
Convert to PDF
$ rsvg-convert -f pdf [input.svg] -o [output.pdf]
copy
Resize output
$ rsvg-convert -w [800] -h [600] [input.svg] -o [output.png]
copy
Set DPI
$ rsvg-convert -d [300] [input.svg] -o [output.png]
copy

SYNOPSIS

rsvg-convert [options] [files...]

DESCRIPTION

rsvg-convert renders SVG files to various raster and vector formats. It uses the librsvg library for high-quality SVG rendering.

PARAMETERS

-o, --output file

Output file.
-f, --format format
Output format (png, pdf, ps, eps, svg).
-w, --width px
Width in pixels.
-h, --height px
Height in pixels.
-d, --dpi-x dpi
Horizontal DPI.
-p, --dpi-y dpi
Vertical DPI.
-a, --keep-aspect-ratio
Preserve aspect ratio.
-b, --background-color color
Background color.

EXAMPLES

$ # SVG to PNG
rsvg-convert icon.svg -o icon.png

# SVG to PDF
rsvg-convert -f pdf diagram.svg -o diagram.pdf

# Resize to width
rsvg-convert -w 512 logo.svg -o logo.png

# High DPI for print
rsvg-convert -d 300 -p 300 graphic.svg -o print.png

# With background
rsvg-convert -b white input.svg -o output.png

# Multiple files
rsvg-convert -f pdf *.svg -o combined.pdf
copy

INSTALL

sudo apt install librsvg2-bin
copy
sudo apk add rsvg-convert
copy
sudo zypper install rsvg-convert
copy

CAVEATS

Not all SVG features supported. Part of librsvg. For complex SVGs, consider Inkscape.

HISTORY

rsvg-convert is part of librsvg by the GNOME Project, originally by Raph Levien, for SVG rendering.

SEE ALSO

inkscape(1), convert(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid