I am currently working with a <canvas> element to create vector graphics and I want to ensure that it displays in the highest quality possible while using minimal resources across various viewing conditions. Specifically, I aim to achieve a 1:1 mapping between canvas pixels and device pixels to avoid blurry images and time-consuming pixel scaling operations.
I have come across some information about "Retina" displays and how the devicePixelRatio can help achieve this, but most sources assume viewing at 100% zoom level. Additionally, discussions about detecting zoom levels seem complex and imprecise, making it challenging to maintain the desired 1:1 ratio accurately.
Here are some questions that arise from this practical and theoretical perspective:
In modern browsers (released within the past 6 months), what is the best approach to achieve a 1:1 canvas without compromising on quality? Do I really need to detect both the device pixel ratio and zoom levels, accounting for changes in zoom as well?
If resource consumption is not an issue, would a 2:1 canvas resolution be beneficial (native resolution on "Retina" displays and up to 200% zoom compatibility elsewhere)? Is downscaling preferable to upscaling in such scenarios?
How do browser vendors address these concerns? Are there ongoing developments to provide better solutions, or is zoom level management considered a trivial matter for web developers? [Partly answered here: Many acknowledge its importance, but debates exist over adapting devicePixelRatio with zoom levels or introducing a new property for user-specified zoom detection and DPI differentiation.]
What percentage of internet users browse at non-100% zoom levels, especially those with high DPI displays? Are there any statistics available on this behavior? [Addressed here: Approximately 10% of Gmail users utilize non-100% zoom settings.]