<img src="pear-mobile.jpeg" srcset="pear-mobile-2x.jpeg 640w 2x, pear-mobile-1.5.jpeg 640w 1.5x, pear-mobile-3x.jpeg 640w 3x, pear-tablet.jpeg 1280w 2x, ..., ..., pear-desktop.jpeg"> |
<img src="pear.jpeg"> |
Image type is negotiated at the HTTP layer (via Accept)
DPR selection is negotiated at the HTTP layer (via CH)
… Same img tag, but HiDPI and multi-format friendly (and easily automated).
<img src="pear-mobile.jpeg" |
Same as first example, DPR and image type negotiated at HTTP layer
srscet provides optional resolution selection + basic art direction
<img srscet=" img.jpg 3x, img.jpg 2.5x, img.jpg 2.2x, img.jpg 2x, img.jpg 1.8x, img.jpg 1.7x, img.jpg 1.6x, img.jpg 1.5x, img.jpg 1.3, img.jpg 1x” /> </facepalm> |
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
I think we need to distinguish between 3 major use-cases for responsive images:* DPR based resolution-switching
* Viewport based res-switching* MQ based art-directionThe latter two may look similar (both can usually be controlled based on viewport width, at least in most cases), but they are inherently different.
I believe that the two cases of res-switching can and should be merged. That can be done by defining some base viewport width, with the 'x' qualifier redefined as a multiple of the DPR and the base viewport width. (e.g. 3x meaning either one of: "This is 1x DPR with a viewport width of 3*base", "This is 1.5x DPr with a viewport width of 2*base", etc). Obviously, since this is a change of semantics without changing the syntax, this should happen quickly and would require consensus from the WebKit folks, in order to avoid compatibility issues.Assuming this makes sense and accepted for srcset, the same "x" semantics can also be applied to CH, resulting in better server side resolution switching, without compromising caching with multiple CH values.
I think we need to distinguish between 3 major use-cases for responsive images:* DPR based resolution-switching
* Viewport based res-switching* MQ based art-directionThe latter two may look similar (both can usually be controlled based on viewport width, at least in most cases), but they are inherently different.
Yup. The "usually" part is why it's say it's "good enough".. assuming we agree that such mechanism is needed in the first place. Do you know why WebKit skipped the viewport res-switching in their current implementation, and if there are plans to add that?
I believe that the two cases of res-switching can and should be merged. That can be done by defining some base viewport width, with the 'x' qualifier redefined as a multiple of the DPR and the base viewport width. (e.g. 3x meaning either one of: "This is 1x DPR with a viewport width of 3*base", "This is 1.5x DPr with a viewport width of 2*base", etc). Obviously, since this is a change of semantics without changing the syntax, this should happen quickly and would require consensus from the WebKit folks, in order to avoid compatibility issues.Assuming this makes sense and accepted for srcset, the same "x" semantics can also be applied to CH, resulting in better server side resolution switching, without compromising caching with multiple CH values.
This is new (that's one red flag).
Further, this seems counter-productive: you're fabricating a new abstract (and non-intuitive) unit and hiding information in the process. As you pointed out DPR and device res-switching are different problems - no reason to mix them together here. Also, there is a *huge* variety of screen sizes on Android devices (only a few on iOS) -- my Google Analytics shows 129 different resolutions! Multiply that out by number of DPR values, and we're looking at 1000+ variants with a completely abstract unit space "use this image for 1450x" - what's 1450X? Is that an in image for a large screen, or a high DPI one? ... =/
I agree with Ilya's short answer, but the longer answer warrants a long reply :)I think we need to distinguish between 3 major use-cases for responsive images:* DPR based resolution-switching
* Viewport based res-switching* MQ based art-directionThe latter two may look similar (both can usually be controlled based on viewport width, at least in most cases), but they are inherently different.
With res-switching, the browser can and should fall back to a lower res image if things get rough (low BW, low battery, user setting because of roaming plan, etc). The user in this case, will receive the same image authors intended him to receive, but in lower resolution.
With art-direction, doing so will present the user with a broken layout, or an indecipherable image, resulting in bad UX.
I think we need to distinguish between 3 major use-cases for responsive images:* DPR based resolution-switching
* Viewport based res-switching* MQ based art-directionThe latter two may look similar (both can usually be controlled based on viewport width, at least in most cases), but they are inherently different.
Yup. The "usually" part is why it's say it's "good enough".. assuming we agree that such mechanism is needed in the first place. Do you know why WebKit skipped the viewport res-switching in their current implementation, and if there are plans to add that?The reasoning I know is in the initial bug. I'm not aware of any plans to add them, but will discuss it (and the w/h syntax in general) with Ted in the Paris meet-up.
The reason I don't think the w/h syntax is good enough is that it cannot address both viewport res-switching and art direction at the same time. You have to choose either one or the other, when both are extremely important (one for performance optimization and the other for content optimization).
Other than that, mixing both viewport and DPR res-switching can lead to duplicate mentions of the same resource.E.g.<img src="c...@1x.png" srcset="c...@2x.png 2x 320w, c...@2x.png 1x 640w, c...@4x.png 2x 640w, c...@4x.png 1x 1280w">
I believe that the two cases of res-switching can and should be merged. That can be done by defining some base viewport width, with the 'x' qualifier redefined as a multiple of the DPR and the base viewport width. (e.g. 3x meaning either one of: "This is 1x DPR with a viewport width of 3*base", "This is 1.5x DPr with a viewport width of 2*base", etc). Obviously, since this is a change of semantics without changing the syntax, this should happen quickly and would require consensus from the WebKit folks, in order to avoid compatibility issues.Assuming this makes sense and accepted for srcset, the same "x" semantics can also be applied to CH, resulting in better server side resolution switching, without compromising caching with multiple CH values.
This is new (that's one red flag).Maybe an orange flag? :) I agree that introducing new stuff at this stage is late, but it's not yet too late IMO. Maybe I'm wrong.
What is "viewport based res-switching"? In what cases would you do that, and to what effect?
Ilya, do you know if Ben Greenstein still has plans to update his existing CL (which you mentioned in the thread)? I ask as it may be useful to get Yoav's help bringing it up to date otherwise.
I think we need to distinguish between 3 major use-cases for responsive images:* DPR based resolution-switching
* Viewport based res-switching* MQ based art-directionThe latter two may look similar (both can usually be controlled based on viewport width, at least in most cases), but they are inherently different.
Yup. The "usually" part is why it's say it's "good enough".. assuming we agree that such mechanism is needed in the first place. Do you know why WebKit skipped the viewport res-switching in their current implementation, and if there are plans to add that?The reasoning I know is in the initial bug. I'm not aware of any plans to add them, but will discuss it (and the w/h syntax in general) with Ted in the Paris meet-up.
Got it, thanks. Agreed, this sounds like a great topic to discuss at the meetup in Paris.On a somewhat related note, do you know what the status of srcset on Mozilla/IE side?
The reason I don't think the w/h syntax is good enough is that it cannot address both viewport res-switching and art direction at the same time. You have to choose either one or the other, when both are extremely important (one for performance optimization and the other for content optimization).
Other than that, mixing both viewport and DPR res-switching can lead to duplicate mentions of the same resource.E.g.<img src="c...@1x.png" srcset="c...@2x.png 2x 320w, c...@2x.png 1x 640w, c...@4x.png 2x 640w, c...@4x.png 1x 1280w">
Right, hence my motivation for pushing DPR switching into HTTP layer -- the above example only shows the 2x case, so the problem is actually much worse.
I believe that the two cases of res-switching can and should be merged. That can be done by defining some base viewport width, with the 'x' qualifier redefined as a multiple of the DPR and the base viewport width. (e.g. 3x meaning either one of: "This is 1x DPR with a viewport width of 3*base", "This is 1.5x DPr with a viewport width of 2*base", etc). Obviously, since this is a change of semantics without changing the syntax, this should happen quickly and would require consensus from the WebKit folks, in order to avoid compatibility issues.Assuming this makes sense and accepted for srcset, the same "x" semantics can also be applied to CH, resulting in better server side resolution switching, without compromising caching with multiple CH values.
This is new (that's one red flag).Maybe an orange flag? :) I agree that introducing new stuff at this stage is late, but it's not yet too late IMO. Maybe I'm wrong.
I think this discussion is better continued in a separate thread and as a separate initiative. *If* it pans out, that's a major revision to the spec (effectively, a v2), at which point the implementations can be updated -- optimistically, if that were to happen, that would still take a while. (Personally, I'm not on the optimistic side based on description so far).In the meantime, we know that DPR-switching is a *big problem*, and we need a solution. srcset with DPR switching addresses that, and we should move forward - we've delayed long enough.
In the meantime, we know that DPR-switching is a *big problem*, and we need a solution. srcset with DPR switching addresses that, and we should move forward - we've delayed long enough.Sure, as long as it's clear we're solving only a part of the problem, and we'll need to further iterate on the solution until the major use cases are solved.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Now that blink is going to tie devicePixelRatio to browser zoom, will this complicate the implementation of srcset?Or should browser zoom not affect what is chosen with srcset? (according to the spec it should)
WebKit doesn't change DPR and Firefox doesn't implement srcset, so blink would be the first one who has to deal with this.