While srcset is awesome und just made it into core with 4.4, its not the right technique for implementing different file formats; thats what <picture>
(among others things) is for, see https://jakearchibald.com/2015/anatomy-of-responsive-images/#varying-on-type.
Browsersupport: https://caniuse.com/#search=picture
But the nice thing is: “…falls back to the <img> in other browsers.”
So, a non-breaking improvment ??
Therefore i really would like to see such a feature, e.g. taking the <img>
-output from wordpress including srcset and sizes and converting it to <picture>
.
In my understanding something like this is possible:
<picture>
<source type="image/webp" srcset="snow-320.webp 320w, …" sizes="…">
<source type="image/jpg" srcset="snow-320.jpg 320w, …" sizes="…">
<img alt="Hut in the snow" src="snow.jpg">
</picture>