Hello. please tell me where is my mistake. The task is to save the block as an image. I do this as follows:
html2canvas($('.gameTable'),{ onrendered: function (canvas) { $('#download').attr('href', canvas.toDataURL("image/png").replace("image/png", "image/octet-stream")); $('#download').attr('download', prefix+'_'+type+'_'+size+'.png'); $('#download')[0].click(); } }); Tried it like this:
html2canvas($('.gameTable'), { onrendered: function (canvas) { var newCanvas = document.createElement("canvas"); newCanvas.setAttribute('width',1000); newCanvas.setAttribute('height',1000); var ctx = newCanvas.getContext('2d'); ctx.drawImage(canvas,0,0,canvas.width, canvas.height,0,0,1000,1000); var dataURL = newCanvas.toDataURL(); var img = $(document.createElement('img')); img.attr('src', dataURL); $('#download').attr('href', newCanvas.toDataURL("image/png")); $('#download').attr('download', prefix+'_'+type+'_'+size+'.png'); $('#download')[0].click(); } }); As a result, I get a poor quality image, in any case, the customer is not satisfied. Here is the saved scripts option: 
Here is a save with the Lightshot: 
Although I am now looking at the attached images and I don’t see any particular differences, tell me if there is any mistake in my actions. Thanks in advance to everyone.