Command line tool for compressing a png into an svg
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.


This is a simple tool invoked from the command line which converts a png into an svg that uses jpeg compression. This can significantly reduce image sizes for use on the web.


Download and unzip the built version, then invoke from the command line or run as a node-webkit app.



d:\png2svg\png2svg.exe -f d:/image.png -q 0.7


-f, --file          Absolute path to png file to convert into an svg
-q, --quality       Image quality, 0-1 (default 0.83)
-s, --show          Keep the node-webkit window open when finished
-p, --webp          Use webp instead of jpeg for the embedded dataUrl


  • You must provide an absolute file path
  • The generated svg file will be written to the same directory with the same name as the png, but with the .svg extension
  • Use -s to show info/errors (I'd prefer to have all the interaction via command line, but node-webkit doesn't have support for this)
  • Make sure your server gzips svgs!

Related / Thanks