Thanks for contributing an answer to Stack Overflow! Automate the Boring Stuff Chapter 12 - Link Verification. Canvas object toDataURL() method has two arguments: MIME type for the return image data as string, and the quality level of the return image within in range from "0.0" to "1.0". Optimizing canvas. inches) apart across different browers / screen sizes. Not the answer you're looking for? After going through the canvas the original dpi is ignored and the new default dpi would be 96 so now the image would print as about 3.1x3.1" on the paper but now better match how it looks on screen. Did find rhyme with joined in the 18th century? Is there an alternative library I can use? Will it have a bad influence on getting a student visa? How to get cropped image length correctly? That is, there's no drop in (print) quality due to. Site design / logo 2022 Stack Exchange Inc; user contributions licensed under CC BY-SA. If quality is not passed the default value is used. How can I make a div not larger than its contents? What are some tips to improve this product photo? You can Scale up your canvas for a single "Capture frame.". I've confirmed this by taking a large 2048x1024 canvas and calling toDataURL on it and then I get back roughly an image that's half the size (in terms of pixels). If you make your download button an anchor you can highjack it right before the default anchor functionality is run. So if the renderer is a printer, able to print at 300dpi, that will do one dot per pixel. How can I make a script echo something when it is paused? How do planetarium apps and software calculate positions? The toDataURL() method is a method from the Canvas API that allows you to store an image drawn on top of the