Skip to content

SVGToPNG ​

svg_png Tool

SVGToPNG is a command-line utility for batch converting SVG files to PNG images. It is installed by the Setup (component "SVG to PNG Convert Tool").

It supports:

  • Wildcard patterns for batch processing (e.g. *.svg)
  • Multiple output sizes in a single run (e.g. 16,32,48,64,128,256)
  • Optional fixed color, grayscale and opacity settings

Usage ​

SVGToPNG convert -in:<InputPattern> -size:<Sizes> <options>
OptionDescription
-in | -i:<in>SVG input file or wildcard pattern (e.g. *.svg)Required
-size | -s:<size>PNG sizes separated by comma (e.g. 16,32,48,64)Required
-out | -o:<out>Output folder for generated PNG filesOptional
-color | -c:<color>Fixed color to apply (e.g. clBlack, #FF0000)Optional
-grayscale | -g:<grayscale>Convert to grayscaleOptional
-opacity | -a:<opacity>Opacity value from 0.0 to 1.0Optional

Examples ​

Convert all the SVG files of a folder to PNG images of 32x32 pixels:

SVGToPNG convert -in:"C:\icons\*.svg" -size:32

Convert a single file to four sizes, in another folder:

SVGToPNG convert -in:"C:\icons\home.svg" -size:16,32,48,64 -out:"C:\output"

Convert all the SVG files of the current folder to grayscale PNG images of 256x256 pixels:

SVGToPNG convert -in:"*.svg" -size:256 -grayscale

TIP

To convert a single SVG file from Windows Explorer, you can also use the Export to PNG files command of the context menu.

Released under Apache License, Version 2.0.