NEW297498
1x images should use integer upscaling
https://bugs.webkit.org/show_bug.cgi?id=297498
Summary 1x images should use integer upscaling
Will
Reported 2025-08-15 20:03:01 PDT
Created attachment 476425 [details] Screenshot comparisons of integer upscaled graphics vs blurry upscaled graphics With any Retina display Mac, make sure the OS display scaling is set to 200% (AKA 2x). In Safari (as well as Chrome and Firefox) many images, icons, buttons etc. have a blurry "out of focus" appearance. This is because the type of upscaling Safari is using is blurring many images and graphic assets, ruining their inherent clarity, sharpness and detail. Safari should simply display images/graphics as they truly are (via integer upscaling), not making them blurry. Integer upscaling does not change or modify the appearance of images. Blurry upscaling does not respect the fidelity and "creators intent" of images. Many others also noticed this issue, so a developer made an extension for Chrome and Firefox to partially fix this https://tanalin.com/en/projects/smart-upscale/ For a visual example, attached is a screenshot comparison of some image icons from https://bugzilla.mozilla.org/describecomponents.cgi , on the left is with SmartUpscale enabled, on the right is default Chrome upscaling (Safari's upscaling is just as blurry as Chrome's) I know Apple cares about this type of thing, the engineers and devs decided on 200% and 300% scaling for iPhones and iPads for this reason. I believe several Macs also ship with 200% scaling by default. I think this could be a good example of how Apple thinks about computing issues in a holistic vertically integrated way and looks at the whole stack to make sure users have the best experience.
Attachments
Screenshot comparisons of integer upscaled graphics vs blurry upscaled graphics (146.15 KB, image/png)
2025-08-15 20:03 PDT, Will
no flags
Will
Comment 1 2025-08-15 20:09:55 PDT
Oops, there was 1 more link I forgot to share that might be helpful about this type of issue https://github.com/w3c/csswg-drafts/issues/5837#issuecomment-856322903
Radar WebKit Bug Importer
Comment 2 2025-08-22 20:03:12 PDT
Will
Comment 3 2026-05-23 18:06:18 PDT
There's something I thought I should add because I think it could help make a decision easier here: in 2012 I remember getting the first MacBook Pro that had a Retina display, I remember having it next to my MacBook Pro I had purchased the year prior, which provided almost a natural experiment because the displays were physically the same size, the software was the same, they had the same logical resolution ("points"), but of course the MacBook Pro with Retina display had double the pixel density (OS display scaling was of course 2x/200%), and almost immediately I noticed that 1x images and graphics in Safari were much clearer, sharper and more detailed on my "old" MacBook Pro! So I feel very confident in saying this is a regression because an old fashioned low-DPI display should not look better than a Retina display in terms of detail, resolution or sharpness. There are many test patterns you can try that will make it clear integer scaling is the way to go.
Maciej Stachowiak
Comment 4 2026-06-21 12:37:09 PDT
There is a tradeoff here. Drawn images, especially ones with crisp lines and borders, are fairly likely to look better with hard scaling rather than interpolation. But photos or other images with relatively smooth textures and boundaries tend to look better with interpolation. Web developers can opt into pixel-crisp scaling with `image-rendering: pixelated`. It’s currently unlikely we’d change the default.
Will
Comment 5 2026-06-21 18:11:53 PDT
I suppose it's almost a philosophical question of "What is the job of a web browser?". We can quickly get into questionable territory. For example, Microsoft Edge had a feature that automatically enhanced images https://blogs.bing.com/search-quality-insights/may-2022/Turing-Image-Super-Resolution?s=09 I think a web browser should just display images as they are, it's not their place to alter them in any way. If a 1x image/graphic looks low-res, that's because it is! And it's not Safari's fault or the devices fault. I would also add that 1x images/graphics are already not ideal in terms of detail, this blurry upscaling makes a bad situation even worse. And it really does feel weird that you won't experience this problem in Safari on the iPhone 3GS but you will on the iPhone 4 and newer (the iPhone 4 was the first device to have a Retina display). It's a real shame because I know the hardware and software teams made a point of making most Apple devices have displays at 2x/200% or 3x/300% by default, so many Apple devices would benefit from this. It feels like you're leaving something "free" on the table. (as is mentioned in the SmartUpscale extension, this would only work on devices that have integer display scaling like 200%, 300% etc.)
Marat Tanalin
Comment 6 2026-06-24 18:54:11 PDT
(In reply to Maciej Stachowiak from comment #4) > There is a tradeoff here. Drawn images, especially ones with crisp lines and > borders, are fairly likely to look better with hard scaling rather than > interpolation. But photos or other images with relatively smooth textures > and boundaries tend to look better with interpolation. Web developers can > opt into pixel-crisp scaling with `image-rendering: pixelated`. It’s > currently unlikely we’d change the default. Hello, Maciej and the WebKit team. I am the author of the SmartUpscale extension and a long-term (11+ years) integer-scaling enthusiast. No need to change the DEFAULT browser's scaling of images on webpages, so nothing is supposed to break. A simple TOGGLE (checkbox) in the browser's GUI would suffice. The toggle could be UNCHECKED by default (that would always add blur like currently). When checked, the toggle would result in CONDITIONALLY applying DIFFERENT scaling algorithms depending on whether the scale of each specific image is INTEGER: * Nearest Neighbour at integer scales such as 2.0 (with each logical pixel represented as a square block of 2×2 same-color pixels); * regular blurry color-averaging scaling at fractional scales such as 1.5 (with each logical pixel represented as a blurry spot approximately corresponding to a virtual group of 1.5×1.5 physical pixels). At a high-enough pixel density (like at 200% OS-level zoom on a 24-inch 4K monitor), pixelation is almost unnoticeable. What's noticeable is SHARPNESS LOSS, and that sharpness loss is totally UNREASONABLE when the image scale is integer and blur can be avoided using the world's most trivial blur-free scaling algorithm -- Nearest Neighbour. Web-development features such as `image-rendering: pixelated` are NOT RELEVANT here (except for that `image-rendering` property is used under the hood in workaround extensions such as SmartUpscale because that's just the only means available to extensions). The described conditional scaling is a quality-of-life feature supposed to be enabled with a USER-LEVEL GUI option. Note that the scale is supposed to be calculated INDIVIDUALLY for each image on the webpage, including the same image embedded with different sizes (and therefore different scales) in the same page. An extension such as SmartUpscale is better than nothing, but it's just a WORKAROUND which is inherently LIMITED because it's not low-level (unlike web-browser engine) and relies on regular slow client-side web technologies. As a result: * it's impossible to process background images at a reasonable performance; * it's impossible to process images inserted via `srcset` or `<picture>`, at a reasonable performance; * it's impossible to process videos due to lack of a way to determine the actual resolution of the played video; * performance in general suffers, e.g. when scrolling. As an illustrative example of the crucial difference in the look of a real-world webpage with blur and without blur, please see the following screenshots of the same webpage (the "Screenshots" section of the home page of TechPowerUp GPU-Z application) taken in Safari 18.6 (20621.3.11.11.3) and Firefox with SmartUpscale extension at 200% OS-level zoom. Didn't find a way to attach images here, so here are links to the images: * https://tanalin.com/_x/bugs/webkit/blurry-image-scaling/safari.png * https://tanalin.com/_x/bugs/webkit/blurry-image-scaling/smart-upscale.png * https://tanalin.com/_x/bugs/webkit/blurry-image-scaling/combined.gif Please make sure you view the screenshots at 100% scale (with NO SCALING) to prevent blur or any other effects of scaling in the image viewer or web-browser. Apple is well-known for its meticulous attention to detail. The proposed conditional scaling of images to prevent unreasonable quality loss of images perfectly fits that level of attention to detail we know Apple for. Thank you.
Will
Comment 7 2026-06-29 16:35:29 PDT
Related bug that the blurry upscaling causes https://bugs.webkit.org/show_bug.cgi?id=301637 The SmartUpscale extension makes Chrome and Firefox pass the test on https://nico.github.io/hack/web/gamma-upsample.html
Note You need to log in before you can comment on or make changes to this bug.