How to Export Inkscape SVG Files to PNG using the Command Line

Share

It's possible to export the contents of an Inkscape SVG file using command line arguments1. For this, we'd need to do something like this:

"C:\Program Files\Inkscape\bin\inkscape.exe" --export-area-page --export-type="png" my-svg-file.svg

This will automatically create and overwrite without asking a my-svg-file.png. The output filename can be specified with the --export-filename argument.

We can even use a loop to quickly export all SVG files in the current directory:

for %%f in (.\*.svg) do (
    "C:\Program Files\Inkscape\bin\inkscape.exe" --export-area-page --export-type="png" %%f
)

Check Inkscape's wiki for more options.

References

  1. https://wiki.inkscape.org/wiki/Using_the_Command_Line (accessed 2024-06-04) ↩︎
Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments