A picture is drawn in my canvas 1000*1000 , and then saved to the computer. canvas 1000*1000 does not look beautiful on the screen, and if you reduce it to 300*300 , the saved image also becomes smaller and the quality drops.

Is it possible to reduce it somehow, but so that the saved picture remains 1000*1000 ?

 function download() { var dt = canvas.toDataURL('image/jpeg'); this.href = dt; }; 

  • You can make a large invisible and then redraw it into a small one. - user220409

1 answer 1

 canvas { outline: 1px dotted red; } 
 <canvas width=1000 height=1000 style="width:300px; height:300px;"></canvas>