librsvg
librsvg is a free software SVG rendering library written as part of the GNOME project, intended to be lightweight and portable.[2] The Linux command-line program rsvg uses the library to turn SVG files into raster images.
Original author(s) | Raph Levien |
---|---|
Developer(s) | GNOME Project |
Stable release | 2.50.3 (28 January 2021[1]) [±] |
Repository | |
Written in | C, Rust |
Type | Graphics library |
License | GPLv2, LGPLv2 |
Website | wiki |
Backends
librsvg uses two other libraries to perform tasks from reading the file to rendering to the screen:
Adoption
librsvg is developed for the GNOME desktop environment and as such is used by GNOME Files but is also intended to be used in other software applications. As a notable example, wikis hosted by Wikimedia use librsvg to render SVG images.[5] It was once picked for these web applications because it was decidedly "fast but not very accurate", according to MediaWiki.[6]
Upon switching to the cairo vector rendering engine in 2005,[7][8] librsvg became more accurate and more visually pleasing. Since 2012 an independent developer published Win32 console ports rsvg-convert.exe, as of March 2016 version 2.40.13.[9] The rsvg-view manual page is also available online.[10]
Usage
On Linux, an SVG file can be converted to PNG as follows:
$ rsvg-convert --format=png --output=diagram.png diagram.svg
Other supported output formats include PDF, XML, and valid SVG.
References
- "Tags - GNOME / librsvg". GNOME. Retrieved 29 January 2021.
- "librsvg is a library to render SVG files using cairo". librsvg. GNOME. Retrieved May 10, 2012.
- "Librsvg 2.41.0 is released". mail.gnome.org. 2017-01-03. Retrieved 2018-11-20.
- Quintero, Federico Mena (2017). Replacing C library code with Rust: What I learned with librsvg (PDF). Manchester, UK: GUADEC.
- Lucideer (April 27, 2009). "Manual:Image Administration - MediaWiki". MediaWiki. MediaWiki. Retrieved April 6, 2011.
- "SVG benchmarks - MediaWiki". MediaWiki. MediaWiki. Retrieved April 6, 2011.
- Worth, Carl (2 September 2005). "svg shootout". gmane.comp.gnome.lib.librsvg.devel. Retrieved 29 November 2014.
the librsvg maintainers … have now added cairo support to librsvg. Many thanks are due to Caleb Moore and Dom Lachowicz for this work. The source can be compiled --with-cairo and it builds separate librsvg-2-cairo.so and librsvg-2-base.so libraries
- Moore, Caleb (3 November 2005). "using librsvg cairo". gmane.comp.gnome.lib.librsvg.devel. Retrieved 29 November 2014.
Librsvg-2.13 cannot link to libart since that backend was majorly broken when we released 2.13 and thus must link to cairo.
- TumaGonx Zakkum (2012-06-10). "RSVG-Convert SVG image conversion tool". Open Source Software and Windows 32-bit. Retrieved 2016-04-02.
- Paul Brossier, Dom Lachowicz, Alex Larsson, e.a. "rsvg-view" (man page). Archived from the original on 2014-12-28. Retrieved 2014-12-28.CS1 maint: uses authors parameter (link)