LinuxCommandLibrary

svg2png

Rasterize SVG vector graphics to PNG

TLDR

Convert SVG to PNG

$ svg2png [input.svg] [output.png]
copy
With specific width
$ svg2png -w [800] [input.svg] [output.png]
copy
With specific height
$ svg2png -h [600] [input.svg] [output.png]
copy
Scale factor
$ svg2png --scale [2] [input.svg] [output.png]
copy

SYNOPSIS

svg2png [-w width] [-h height] [options] input output

DESCRIPTION

svg2png converts SVG vector graphics files to PNG raster images. It rasterizes the scalable vector content at a specified resolution, producing pixel-based output suitable for web use, documentation, or any context requiring bitmap images.
Output dimensions can be controlled by specifying width, height, or a scale factor relative to the original SVG viewport size. The background is transparent by default, preserving alpha channel information from the SVG source. Various implementations exist based on different rendering libraries such as librsvg or Node.js-based engines.

PARAMETERS

-w WIDTH

Output width.
-h HEIGHT
Output height.
--scale FACTOR
Scale multiplier.
--background COLOR
Background color.
--help
Show help.

CAVEATS

Various implementations exist. Rendering may vary. librsvg or Node based.

HISTORY

svg2png tools exist in various implementations for converting SVG vector graphics to PNG raster format.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community