Closed ozasadnyy closed 7 years ago
Hi, thanks for the suggestion.
What are you thinking as far as how it would work? Maybe something like:
or ??
Here are 3 basic techniques: https://developers.google.com/speed/webp/faq
I am more for second way
Well, this control extends iron-image
which not only doesn't use the <picture>
element, but doesn't even really use the <img>
element - it actually sets the background image of a <div>
in its shadow dom.
I would think it would be necessary to detect support for webp in JavaScript.
So, if there are any webp images in the srcset
, and webp is supported, do we assume the user wants to serve one of those in preference to any of the JPG or PNGs?
Correct. These files are much smaller
I like your idea and it is easy enough to implement. Look for an enhancement to do this in the next couple of days.
Thank you!
Support for webp has been added in PR #13 Add Webp Support. Readme documentation has been updated to reflect the new feature. New version is tagged 1.0.4.
Webp is amazing image format but unfortunately, not all browsers support it. The combination of webp + lazy loading should be super awesome!