-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(hidpr-images): never recommend more than 2x #11518
Conversation
* Moto G4 3x pixel size = 2.7 / 1080 = 0.0025 in | ||
* | ||
* Wasted additional pixels in 3x image = (.00335 - .0025) / (.00375 - .0025) = 68% waste | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate you breaking down the math here in addition to the explanation.
Thanks! I asked some experts about this a bit ago and this is what i heard back
|
@paulirish thanks for those links! Some of that sounds like how we might want to tweak the "images too large audit" is that right? Capping our "too large" audit at a DPR of 2 might be worth a separate discussion 👍 Even if 3x images for pinch-to-zoom are universally a good idea, I'm not sure how we would ever be able to distinguish that use case in Lighthouse such that we would encourage serving a 3x image, right?
😱 whoever came up with that must've been from a family of giants 😄 (most of that data seems to come from desktop where all of that is more reasonable, though monitor size is definitely a big assumption :)) |
I was happy to see this land, folks :)
Yoav and I are exploring if there's enough data to help us decide whether the default behavior in Chrome should be to cap at 2x vs 3x (from what I've seen I'm inclined to agree 2x makes a lot of sense). |
Awesome! We've got some math to help that case you're welcome to borrow :) |
Summary
Updates the high DPR images audit to never recommend images larger than 2x. The case is obvious on mobile, I'm not really aware of 3x DPRs being a thing on desktop yet. The case is strong enough that I might go so far as to say Chrome should intervene and serve the 2x images instead of 3x images on mobile screens, but either way we shouldn't be encouraging it.
Related Issues/PRs
fixes #11505