Grandparent Ready SVGs

SVGs have made the web a better place: graphics are sharper & Retina-ready. We have d3.js, the dataviz library that powers all your favorite NYT infographics. SVG even deserves some credit for Bootstrap’s massive popularity by way of Font-Awesome, the bundled icon font.

However, it isn’t a “consumer” format. I mean, have you ever sent your grandparents an album of vacation SVGs? Of course not, that’s what raster graphics (PNG, JPG, and GIF) are for. (And shoutout to everybody still using TIFF and a scanner from ‘96!)

Let users save your SVGs with saveSvgAsPng from Eric Shull. Just pass in the node and the script will generate a PNG + initiate the download client-side.

Seriously, this is all the code I needed to power my demo:

js saveSvgAsPng(document.getElementById("svg"), "neal.png", {scale: 3.0});

So go forth and design those beautiful, scalable graphics — saveSvgAsPng will get them grandparent-ready.

Comment down 4 what?
2017 Neal Shyam