CSS3 media queries do not have to be Javascript (typically used for orientation change, resizing no longer necessary for this method), but it does not matter if it's all generated dynamically.
The module/plugin handles the setup of media query definitions and creates the image selectors mapped to each query:
1) Using a simple naming convention for image names or paths
2) Or, by creating and referencing a sub-theme or sub-folder named to match the media query
As CSS cascades one can still apply custom styles to images as they see fit but leave the stylesheet media query and image path/location or naming to the plugin. Quality CMS's will then minify and compress all the CSS to reduce bandwidth.
I probably didn't explain my lack of understanding particularly well
The browser has the information about viewport size etc. How does this information get back to the server so that it can serve up the correct images? HTTP headers don't contain this info, there has to be something on top of the standard protocols to do this. UA sniffing only gets you so far.
A search for "rwd images" comes up with quite a few solutions including the proposed picture element but most (all?) require something to send that information back - Adaptive Images seems to be the best regarded of these. Quite a few also require two HTTP requests, one for the default image then one to serve up the optimum version.
If I have a stylesheet containing my media queries and linked like this:
PHP:
<link rel="stylesheet" type="text/css" href='style/style.css' media="screen" >
Containing something like:
PHP:
@media (max-width: 500px) {
html {
background-image: images/width-narrow.png;
}
}
@media (min-width: 501px) and (max-width: 640px) {
html {
background-image: images/width-slim.png;
}
}
etc
Since the stylesheet gets parsed before most of the rest of the page it would mean that the server monitors the requests and then serves up appropriate images depending on whether width-narrow, width-slim, etc are requested. It does mean that the server has to retain state for each connection though, probably through sessions.
Is this what you mean? If it isn't then I still can't see how the parts of the system link up.