That would be way saner, the problem is that it seems no one wants wants to touch HTTP. Browser vendors work under the assumption that whatever feature they implement, it only has a chance of being adopted if it can be hacked in other browsers with javascript shims.
It should be up to the browser and the image file format to determine the best option.
Both Jasper support this (ilyrrates) and OpenJpeg (-r and -q) support this functionality.
<picture>
<source srcset="foo.jp2 100w 100h range=1-<first layer>">
<source srcset="foo.jp2 500w 500h range=1-<middle>">
<source srcset="foo.jp2 1000w 1000h">
</picture>
That'd avoid the need to a round trip at all and it'd also be a huge improvement for caches which support HTTP range correctly since it'd be a single resource rather than multiple different URLs. It'd also allow browsers to start making decisions like selectively preloading more of an image which the user is likely to zoom, etc. although some of that would come simply from a good progressive JP2 implementation.That's largely opinion: are byte ranges really better than having to maintain clusters of related images? Any serious site already has to deal with things like cache invalidation when a source file changes and by the scale of things which sites do for performance this is certainly no worse than, say, JavaScript/CSS minification or UA sniffing.
It would be way more flexible and even easier to implement, since you don't have to revisit all your markup.
Yes, unfortunately we have to rely on a small client side javascript to detect your client's properties but the solution allows you to both upload and reference one and the same image and URL regardless of client and we'll scale, re-sample and even crop on the fly and cache the formatted image for future requests. We are trying to provide an experience as seamless as HTTP content negotiation.
Also, this solution can be built into a Javascript shim for older browsers, something header-based would be much harder to do as a shim.
Why? There's no difference on the server side, you would have multiple versions of the same file anyway. You're just exchanging the responsibility of getting the right file from the markup to responding with the right file on the server (which is way easier to keep consistent, IMO).
In an ideal world, it would be server side. But it would easily mean twice as much work to get there.