Reputation: 2237
As many of you know, there are quite a few websites that sell royalty free graphics. Some sites sell vector graphics (svg) or give you the option to download them as such.
I don't have a graphics editor that will support SVG. Currently, I'm working with an older version of Fireworks. I cannot open a SVG file type. (I also cannot afford to purchase PhotoShop or Illustrator software).
I'm running Windows on my PC.
Questions:
Upvotes: 14
Views: 53012
Reputation: 5149
For a single image, if you do not want to install any additional SW, you can do the following (on Windows, should work on Linux similarly):
Please note: Transparency will be lost (as stated by @come-raczy)
width
and height
attributes of the <svg></svg>
node to your needs<WINDOWS><SHIFT>S
Upvotes: 4
Reputation: 1680
svgexport is a Node.js module and command-line tool that is very good in the context of SVG to PNG converters. It uses Pupeteer, a library to control headless Chrome/Chromium over DevTools Protocol.
Important highlights include:
The link to NPM provides the install instructions (npm install svgexport -g
) but doesn't provide all dependencies. On WSL Ubuntu, I had to install additional libraries:
sudo apt install libxdamage1 libnss3-dev
Basic usage is very straightforward:
svgexport input.svg output.png
There are additional options to control style, quality, sizes, and format (png, jpg, or jpeg).
Upvotes: 1
Reputation: 499
Upvotes: 20
Reputation: 61026
I'd recommend downloading Inkscape, which is the freeware equivalent of Illustrator. It can export svg to png, and it uses SVG as its native image format.
Upvotes: 20
Reputation: 21388
I'm going to guess you're on Windows, but on Linux I use librsvg2-bin.
Then use rsvg-convert -o output.png input.svg
A quick google search brought me this if you're only going to be able to use Windows: http://www.openclipart.org/wiki/SVG_Tools
Upvotes: 10