how to save my canvas as an image with canvas.toDataURL():
here is my code:
var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
hrefattribute to your url.
downloadattribute to the desired filename.
clickevent on your element.
Or just see this answer here.