1canvas {
2 image-rendering: -moz-crisp-edges;
3 image-rendering: -webkit-crisp-edges;
4 image-rendering: pixelated;
5 image-rendering: crisp-edges;
6}
1var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
2window.location.href=image; // it will save locally