Hello again. I’ve forked the wonderful Obama Voronoi Stippling portrait and made a variation with a photograph of myself with my wife. I’d like to export a copy of the canvas and have a print made as a Christmas present (Don’t tell her!). Is there a way to do that? The saving-svg tricks I’ve tried aren’t working.
I suspect this is a feature others would like to take advantage of. If it is possible, I’d appreciate it if you didn’t blast the portrait I’ve made outside this forum, just because I wouldn’t want her to find out about it before I give the gift.
How charming! Pretty easy fix: this notebook is using Canvas, not SVG, so you don’t need to do anything fancy to download the image. You can either right-click the image to save it, or you can use canvas.toBlob as shown here:
Sure. You can change the width and height of the Canvas to be whatever you want. Or, you could redefine the portrait cell to generate SVG instead of Canvas, and then use @mbostock/saving-svg’s serialize to download the SVG file. (I also changed it to only render once at the end, since rendering the intermediate state just makes rendering slower…)
So I didn’t implement SVG just yet (going to look at that notebook by @mbostock in a bit) because I got too distracted playing around with tweaking values to generate a stippled image that looks nice
It uses white dots on a black background - in the browser the points are scaled away, try saving the higher resolution image to see what it would look like.