Javascript WebP Library
JavaScript
Failed to load latest commit information.
alpha loadeddata event Oct 10, 2010
experimental chroma predictiono Oct 21, 2010
README updated readme Oct 17, 2010
browsers.webp webp-encoded image with all the browsers that are supported Oct 9, 2010
circles.png blah Nov 17, 2010
circles.webp blah Nov 17, 2010
circles2.png blah Nov 17, 2010
circles2.webp blah Nov 17, 2010
demo.html shortened Oct 15, 2010
graysquare.png blah Nov 17, 2010
graysquare.webp
mandelbrot.webp demoo Oct 3, 2010
mozbug.html gonna try submitting a relevant mozila bug, heres teh testcase Oct 14, 2010
tinybrot.webp changed from mandelbrot to tinybrot because tiny is faster Oct 3, 2010
webpconv blah Nov 17, 2010
weppy.js

README

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.