1

I'm trying to save a canvas as a image, which i then download. And it's working - using html2canvas.

However the quality is not acceptable, images inside the canvas is pixelated and text is in pretty bad condition as well.

Anyone know of a alternative to html2canvas which support higher DPI / can give me a better result.

html2canvas(target, {
  onrendered: function(canvas) {
    var data = canvas.toDataURL("image/png", 1);
    download(data, "Graph.png", "image/png");
    //window.open(data); // while testing, instead of download.
  }
});
Anders Pedersen
  • 2,255
  • 4
  • 25
  • 49
  • It's the only quality you'll have for a PNG. See this answer: http://stackoverflow.com/a/31726736/5119765 – ADreNaLiNe-DJ Mar 31 '16 at 13:58
  • Are you trying to generate it (1) for personal use or (2) in a team or (3) for thousands of users visiting your page? (1) There's [a screenshot CLI in Firefox](http://stackoverflow.com/a/14830242/137626), (2) PhantomJS/CasperJS/PhantomCSS are great tools against visual regression (not node.js tools but available from this environment, also with gulp maybe grunt) (3) I dont't know – FelipeAls Mar 31 '16 at 14:24

0 Answers0