Wednesday, April 20, 2011

WebP

Overall the reception to WebP that I've seen so far has been pretty negative. Jason Garrett-Glaser wrote a popular review, but there have been similar response from others like Charles Bloom. Since these reviews, the WebP encoder has improved on the example used by Jason (old vs. new) but it's still not a lot better than a decent JPEG encoding. I also have a couple of thoughts on the format that I'd like to share.

Google claims it's better than JPEG but this study has some problems and as a result, isn't very convincing (Update: Google has a new study that's better). First, they recompress existing JPEG's. This is unconventional. Perhaps recompressing JPEG's is their target market, but I find that a little weird and it should at least be explained in the study. Second, they use PSNR as a comparison metric. This is even more confusing. PSNR has, for a while now, been accepted as a poor measure of visual quality and I can't understand why Google continues to use it. I think it would help the format's credibility if Google did a study that used uncompressed source images, SSIM as a metric and provided enough information about the methodology so that others could reproduce their results.

WebP also comes across as half-baked. Currently, it only supports a subset of the features that JPEG has. It lacks support for any color representation other than 4:2:0 YCrCb. JPEG supports 4:4:4 as well as other color representations like CMYK. WebP also seems to lack support for EXIF data and ICC color profiles, both of which have be come quite important for photography. Further, it has yet to include any features missing from JPEG like alpha channel support. These features can still be added, but the longer they remain unspecified, the more difficult it will be to adopt.

JPEG XR provides a good example of what features you'd want from a replacement for JPEG. It has support for an alpha channel and HDR among others. Microsoft has also put in the effort to have it formally standardized. However, it too is not without problems. The compression improvements it claims haven't matched evaluations other parties have done. I don't know enough about JPEG XR to say whether this is because the encoders are bad or because the format is not really that great.

Every image format that becomes “part of the Web platform” exacts a cost for all time: all clients have to support that format forever, and there's also a cost for authors having to choose which format is best for them. This cost is no less for WebP than any other format because progressive decoding requires using a separate library instead of reusing the existing WebM decoder. This gives additional security risk but also eliminates much of the benefit of having bitstream compatibility with WebM. It makes me wonder, why not just change the bitstream so that it's more suitable for a still image codec? Given every format has a cost, if we're going to have a new image format for the Web we really need to make it the best we can make it with today's (royalty-free) technology.

Where does that leave us? WebP gives a subset of JPEG's functionality with more modern compression techniques and no additional IP risk to those already shipping WebM. I'm really not sure it's worth adding a new image format for that. Even if WebP was a clear winner in compression, large image hosts don't seem to care that much about image size. Flickr compresses their images at libjpeg quality of 96 and Facebook at 85: both quite a bit higher than the recommended 75 for “very good quality”. Neither of them optimize the huffman tables, which gives a lossless 4–7% improvement in size. Further, switching to progressive JPEG gives an even larger improvement of 8–20%.

History has shown that adoption of image formats on the internet is slow. JPEG 2000 has mostly failed on the internet. PNG took a very long time, despite having large advantages. I expect that adoption may even be slower now than it was in the past, because there is no driving force. I would also be surprised if Microsoft adopted WebP because of their stance on WebM and their involvment in JPEG XR. Can WebP succeed without being adopted by all of the major web browsers? It's hard to say, but it wouldn't be easy. Personally, I'd rather the effort being spent on WebP be spent on a improved JPEG encoder or even an improved JPEG XR encoder.

Is JPEG still great? No. Is there a great replacement for it? It doesn't feel like we're there yet.

In the hopes of being more concrete, how would you feel about adding WebP support in Firefox if it gained support for ICC profiles, an alpha channel, and other colorspaces? I'm trying to gauge whether "lacks features", "encoder not good enough", "waiting until other people use it" or "other" are the key blockers.

Peter:Why don't you approach the PNG standards body to add another compression stream to the format?The world doesn't need a new container format that is as terribly designed as WebP. Dare I say its not even a container, but a few byte header before raw data..

IMO, it's "lacks features", "waiting until other people use it" and "other": solution looking for a problem.

WebM is a much needed format, whereas WOFF and WebP are not. Please stop dividing the Web from the non-Web.

Comments above argue that WebP now is totally different from WebP six months ago and any number of wanted features are totally being experimented with. Somehow I don't see how that helps the case that browsers should support WebP right now? What's so wrong with waiting to see if it settles into a decent and useful file format?

For many uses, your arguments don't matter. In fact, the examples of image sites you gave, especially facebook, could see a huge benefit from much smaller and (to the naked eye!) clearer images. As a photographer, I tend to be a purist, desiring image quality regardless of image size or clunk, but Facebook and a lot of other sites have needed a way to make much smaller without sacrificing their already shit quality. And on top of that, you might actually see these sites let you put up bigger, higher quality images, especially considering how little screen real estate is being used by the majority of people these days.At the same time, rather than arguing against the format, wait until it's complete. Clearly, they are still putting work into it.You make some good points, but for people who don't need to do anything but put a rectangular image up on a social networking site, this method could easily do what people require. There is nothing wrong with new standards when they are better. Are you that guy still standing up for copper too? Even though we know we are starting to push up against the wall of limitations? New isn't bad. If you can't even show a better alternative, or even comparable alternative, your entire post is pretty much moot.

@JeffRegarding the sample image, the sequential example contains ~20K of Profiles data that the progressive one does not. Other then that it does seem that progressive saves around 5% on that image.I'd like to point out a study by Stoyan Stefanov (Then @Yahoo) http://www.yuiblog.com/blog/2008/12/05/imageopt-4/This study shows a median 2.7% improvement resulting from use of progressive JPEGs on web images, and that larger image are more likely to be better compressed progressively, while smaller ones are better off as sequential JPEG.All in all, while JPEGs can be better compressed by better encoders, progressive JPEG is not a silver bullet, and better encoders can also be used to improve WebP quality.All in all, we need a better format, with modern compression techniques and with Alpha channel (to which the WebP team seem to be committed, even if it's currently not supported). While I agree that WebP is not feature complete and is still a work in progress, there's a big difference between saying "We may support it once it implements A,B,C" and saying "it lacks A,B,C so we don't support it".Please reconsider.

Google Chrome already has slightly better HTML5 support then Firefox. And statics already say Chrome is faster then Firefox (while I don't believe it, sometimes Firefox just feels faster then Chrome). If Firefox also is going to lack support for WebP. It really is going to use losers. I already twice chose Firefox above Chromium because sometimes Firefox *feels* faster. Plus it has a lot more addons then Chromium. If Chromium always felt faster then Firefox I might seriously leave Firefox and consider using Chromium!

And what' s wrong with supporting a image format which hasn't proven itself yet? WebP is open source and Google has the reputation to release good tools, api' s and documentation. It shouldn't be that much work to add WebP support. It wouldn't cost you years of precious time to add support.

Looks like Google has addressed a lot of the format's missing features now (http://googlecode.blogspot.com/2011/11/lossless-and-transparency-encoding-in.html). I'd be interested in seeing what your thoughts are now that transparency, ICC profiles, XMP metadata have all been added to the format.

Hey Jeff, after http://blog.chromium.org/2011/11/lossless-and-transparency-encoding-in.html announcing that WebP has gained support for ICC, animation, and alpha transparency in both lossless and lossy modes, I'd love for you to write a new blog post with your opinions on the state of the format, whether you think it's more compelling, and what comments if any Mozilla has on the progress so far.

Well, the format changed a lot and now supports a lot of the features that where missing.. ( http://code.google.com/speed/webp/ ). Would be nice if firefox addopts this new format. I think there isn´t really that much extra work in supporting that special image format, because the api of the lib doesn´t really change.. So it´s just about updating the lib via a pull request once it´s used in firefox..

I think the "let´s stick our head into the sand like a turkey" approach doesn´t work here, because we now have a "chicken egg problem".. If big browsers don´t support webp, it will never get popular..

1) It is open2) It supports lossy transparency compression (and lossless)3) Lossy or lossless, it features great compression/quality rates4) It has a ton of useful features (transparency, XMP metadata, ICC profiles, animation, tiling, etc)5) It is evolving at an amazing rate

JPEG has been around for 20 years, and web images have stagnated with the closed format. It's time to move on, and an open platform like WebP with great performance and features is something solid to build upon.

I have to agree with many of the commenters, now is the time to reconsider integrating webp to help improve the format by gaining critical mass.Firefox is visibly starting to fall behind the curve and browser market share the way IE did, so for the sake of progress please re-evaluate the specification and your stance - at the very least post to the bug if you feel this way still.

As web developers, we just want to be able to use the best technology to make the best experience for users. I'd like to start using WebP in my sites, but can't because of lack of support in Firefox... too bad.