Package 'minisvg'

Title: Convert SVG to PNG Images
Description: Lightweight SVG to PNG renderer based on resvg.
Authors: Jeroen Ooms [aut, cre]
Maintainer: Jeroen Ooms <jeroenooms@gmail.com>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-10-12 12:41:32 UTC
Source: https://github.com/jeroen/minisvg

Help Index


Render SVG to PNG

Description

Converts an svg string to a PNG image using resvg.

Usage

svg_to_png(svg, opts = list(), output = "output.png")

Arguments

svg

string or raw vector with svg image

opts

list with rendering options

output

filename of png file

Examples

svg <- readLines("https://upload.wikimedia.org/wikipedia/commons/f/fd/Ghostscript_Tiger.svg")
svg_to_png(svg, output = 'tiger.png')
# browseURL('tiger.png')
unlink('tiger.png')