Skip to main content

Module raster

Module raster 

Source
Expand description

SVG-to-raster conversion using resvg + tiny-skia.

Converts an SVG string into a tiny_skia::Pixmap which can then be encoded to PNG (via tiny-skia’s built-in encoder), JPEG, or BMP (via the image crate).

Functions§

pixmap_to_bmp
Encode a pixmap as BMP bytes.
pixmap_to_jpeg
Encode a pixmap as JPEG bytes.
svg_to_raster
Rasterize an SVG string into a pixel buffer.