Tag Archives: SVG

Batch convert SVG to PNG on Windows using Inkscape

Needed to convert several SVGs to PNG, and discovered the free Inkscape easily can be used in batch scripts.

The following .bat file will convert all SVGs dropped on it to a PNG with height 48 placed next to the original SVG. More options can be found in the Inkscape manual.

@echo off
for %%f in (%*) do (
    echo %%~f
    "C:\Program Files\Inkscape\inkscape.exe" ^
      -z ^
      --export-background-opacity=0 ^
      --export-height=48 ^
      --export-png="%%~dpnf.png" ^
      --file="%%~f"

)