DEMO (Fx4.0 + Chr + Op 10.6): http://antimatter15.github.com/weppy/demo.html === How does it work? === WebP is actually a lightweight container for a single VP8 frame (whereas WebM is a container based off Matroska meant for video). WebM support exists already in Chrome, Firefox and Opera, so all that's needed to render it is to do a little magic to convert the RIFF encoded WebP image into a EBML/Matroska encoded single frame WebM video, loading it in a <video> and replacing the .webp image with the <video> element. === What Browsers? === Chrome 7.0, Opera 10.62, and Firefox 4.0 were tested and functional. It should work in all browsers that support WebM video. === Experimental === There's a folder named "experimental" where some cool experimenting is going on. The aim is to have a real, functioning, pure-javascript (no webm/video dependencies) implementation of the intraframe compression features of vp8, enabling stable, practical use of WebP in most existing browsers, including (theoretically) Firefox 3+, Safari 3.2+, Chrome 4.0+, Opera 10+, and IE9+. It's much more complex than converting to WebM, but should be less prone to crashing (as the canvas apis are old and well tested, well defined, and mature - compared to video support). The current state of the experimental branch is far from complete (and may forever remain as such). Right now, it is capable of parsing the entire uncompressed frame header, implements the boolean entropy decoder, and reads the rest of the (keyframe) compressed header. What remains is parsing out the macroblocks, dequantization, inverse discrete cosine transform, color conversion, deblocking and all the other big words and concepts I don't understand.
Javascript WebP Library
DEMO (Fx4.0 + Chr + Op 10.6): http://antimatter15.github.com/weppy/demo.html === How does it work? === WebP is actually a lightweight container for a single VP8 frame (whereas WebM is a container based off Matroska meant for video). WebMCategory: JavaScript / Video/Audio |
Watchers: 6 |
Star: 109 |
Fork: 12 |
Last update: Jun 21, 2022 |
Hi,
Is weppy able to fix this? In Firefox:
var c = document.createElement('canvas')
c.toDataURL('image/webp')
"data:image/png;base64,....."
If I try the same in Chrome, I get a string "data:image/webp;base64,.....".
Just made this test myself thought i would suggest it webpSupport = /webp/.test(document.createElement('canvas').toDataURL("image/webp"));
Hello, I'm using your library and I see that it works very well. I'm suggesting that you update the library, (commit) so that it is adapted to NPM and also creating a minified version (retaining its license to use). I ask you to see how to publish this feature in npm so that you have your name on it, if you need I can help you with this. I also wanted to see if it is in your interest to turn this library into other packages like typescript, or AMD modules, and commomjs
It would be great if you add SVG support, if possible.
Hey,
I noticed this: i[l].src = 'http://www.motifake.com/image/demotivational-poster/0902/urine-urine-pee-cheap-demotivational-poster-1234913145.jpg'
Loading an external image is bad enough, but wtf? Is that the best image and host you could find? Not even HTTPS.
Regards, Lukas
Also tried 29 beta...
Looks like something changed in Firefox. The webm video is now just a white frame, no pic is shown.
webp has alpha now!
- https://developers.google.com/speed/webp/docs/webp_lossless_alpha_study
- https://developers.google.com/speed/webp/gallery2
Looks like this shipped to Canary and will be available in Chrome 22.
I'd love weppy to manage this for me. AFAIK alpha webp images will just not load (instead of with a matte background) .. so the current onerror will trip for alpha ones, independent of regular non-alpha webp.
weppy could then supply the fallback in this case (see #1).
thoughts?