Overview
Inspiration
The JSFiddle is inspired by the article “Convert SVG to PNG using your browser”.
Breakdown
The steps to save SVG to image are:
Improvements
The improvements made in my example are:
- Added the ability to resize SVG in canvas
- Added the option to update the filename
- Added the option to change the file extension from
png
tojpeg
- Used HTML5 form validation
- Prevented memory leaks by cleaning up event listeners
- Improved accessibility
- Stopped supporting older browsers
Sample SVG
Here are some sample SVG’s you can use to test against the converter: