Google offers JPEG alternative for faster Web
news.cnet.com
news.cnet.com
What probably happened was that they took images and compressed them to WebP and JPEG and compared the sizes.
As for the recompression, you can losslessly squeeze a JPEG by at least 15% (e.g. StuffIt came out with this a few years back, claiming higher numbers but mainly at low bitrates I think). In the lossy camp, H264's intra-frame encoding significantly outdoes both JPEG and JPEG2000.
WebP is probably similar to H264 intra. As for recompression vs. straight compression, this probably has little effect to the extent JPEG and WebP are "compatible", e.g. both being block-based transforms. It would be unfair, on the other hand, to run a very different codec after JPEG and compare it to WebP after JPEG, because the other codec might be working hard to encode the JPEG artifacts.
Exactly. I found Google’s “study” pretty sketchy, given the lack of concrete detail about this. http://code.google.com/speed/webp/docs/c_study.html
Here’s some of what I wrote in an email to a friend:
Since they’re dealing with an arbitrary collection of already encoded images, there are likely e.g. artifacts along JPEG block boundaries that take up extra space in JPEG 2000. While they have a big sample size, they don’t compare the metric used (PSNR) with noticeable quality degradation.
There's a graph of size distribution (which would be a lot more readable if they binned some of the sizes and showed a histogram instead of a sea of overlapping red plus signs), but then compression percentages aren't in any way related to those various sizes: were big images easier to compress better than JPG/JP2? Small images? Looking at the size distribution, a large percentage of these images are absolutely tiny, the kinds of images that as far as I know JPEG 2000 was never intended to be used for. The overhead of the data storage container ends up dominating the size of the image for very tiny images – I don’t know anything about the relative overhead of JPG/JP2/etc. images, but it would be good to include that in any discussion.
It seems to me like the WebP images have their color profiles stripped. Is that an inherent part of WebP? If so, I hope Google doesn’t encourage people dealing with photographs to adopt it in large numbers. Browsers are just finally getting to the point where proper color management of images is expected; no need to regress there.
What if you analyzed all those images and came up with a composite huffman compression that was more efficient than the best guess in the 70s? Then, you did some magic on the quantization table to make the most common vales correspond to the lowest numbers, relying on processing power to decode the compressed quantization table before you started?
"The main trick those three programs use is (partially) decode the image back to the DCT coefficients and recompress them with a much better algorithm then default Huffman coding." - http://www.maximumcompression.com/data/jpg.php
When I did some experiments with various compression techniques, I found that DCT with a LZMA base compared quite well to newer compression systems.
Although there are many inefficiencies left in VP8, and to a lesser extent H.264, when dealing with very large images. One is that the same texture can be repeated in different areas of the same image, but prediction only happens from neighboring pixels, so it can't reuse the same texture in compression. Some solutions are in the JVTVC/H.265 proposals and are usually called "extended texture prediction".
Basically, they are using predictive coding to achieve good lossy compression. However, I agree, I would also like to see double blind studies on the quality degradation.
In the folder is the original image, the compressed version of the image in both jpg and webp, and a enhanced difference map between the compressed version and the lossless image.
Basic analysis shows that right now webp has better preservation of luminance, but at the expense of hue/color. I'll have a blog post up in a bit with a myriad of file tests, difference maps, percentage differences, and hue offsets in a bit.
Very impressive. I can easily live with the 2x decode / 8x encode with those results.
edit: though, if there's no alpha capabilities, count me out. Yes, that's my deciding factor.
Will gladly keep looking, it's interesting either way :) Thanks!
http://blog.chromium.org/2010/09/webp-new-image-format-for-w...
Here is "how to cheat with codec comparisons", http://x264dev.multimedia.cx/?p=472 which exaplains (partially) why PSNR isn't that great when judging image quality.
- No alpha support
- Not lossless support (Useful for the alpha channel, and could encourage more cameras to support lossless images)
- No HDR support
JPEG-XR also allows different regions of the image to be encoded independently. See wikipedia for more features: http://en.wikipedia.org/wiki/JPEG_XR
I have no idea what the patent landscape for JPEG-XR is, but I'd be disappointed if we replaced JPEG and didn't get some of these features.
The lack of alpha support in JPEG is especially a pain for web developers. PNG does not do photos well.
Are there technical reasons to not implement an alpha in jpeg-like compressions?
In my experience, and this seems to be a widely held position, the main use case for jpgs is in pictures, as in photographs. The main use case for png (gif) is for graphical elements: borders, menus, etc. Those last ones you want to compress with a lossless format anyway - you need to be sure that a flat menu background is not dithered or doesn't have other artifacts. I understand the question mostly as 'do you need transparency in photographs' and 'do you need non-rectangular photographs where the non-rectangular nature is encoded in the photograph itself, and not part of another rendering in stage in the presentation layer'.
Thinking about it more, maybe things like drop shadows or other fancy borders could be case where you need transparency in photos. Otherwise you have to work around it by having the picture as jpg and the border as a separate (or several separate) png's. More requests, harder layouting, etc. I'm not convinced yet that this use case alone is a compelling argument.
As for technical reasons to not implement it, I don't know - I'm assuming there are because I'm quite sure that someone at Google must've thought about it and decided against it, they must have had their reasons.
(1) I'm reasoning from the assumption that including transparency has adverse effects on file size and/or decompression complexity. Maybe there aren't in which case balancing features becomes a different matter and most of my argument is moot.
"All patents that WG1 believes to be essential to practice JPEG 2000 Part 1 are available on ITU-T’s patent policy 2.1, which is fee-free (see the ITU-T web site for their interpretation of this)." http://www.jpeg.org/faq.phtml?action=show_answer&questio...
1) "Again, at every JPEG meeting the following resolution is also passed unanimously" appears to be saying each year they vote whether to continue or wether to reel in the bait. Tasty free morsels given by fisherman often turn out to have hooks attached.
2) It appears that one has to give up any patents that read on to a baseline spec for JPEG. This sounds like it could be bad for large multimedia companies who want to retain rights to an image format - what's the baseline. If the baseline is something like "uses huffman codes to compress image data" then this is going to be a potential huge cost in IPR given up.
These are possibly unfounded, just first thoughts at 2am.
Take for instance arithmetic coding option in original JPEG, the only patent-encumbered part of it. Just NOONE ever using it.
JPEG looks better to me. It's only a data point of 1, but it's the most important data point to me. ;)
* a save in bandwidth is huge on mobile speed, google believes that speed effects web use, web use effects revenue
* a save in bandwidth is cheaper for google
* att, verizon, sprint, and tmobile are limiting mobile data plans, smaller images means more web page loads
* net neutrality might fail, you might have to pay for data
* google runs a lot of content via app-engine, gmail + chrome, google should be able to make the switch for the stacks they own to develop an advantage.
* others will follow in adoption like facebook if it saves them on one of their largest costs cdns.
* openness an open format can go on more devices.
* open devices might appear faster on the web.
Modeling and entropy coding are handled on the coefficients generated above. However, this is done on each 8x8 block (note, I am making a slight simplification ignoring the use of differential compression on the DC coefficients between blocks. Since the algorithm is relegated to encoding at most 64 coefficients at a time, there isn't much "modeling" that can be done.
If one reorders the coefficients of the 8x8 blocks to resemble a non-block based transform -- you can perform better modeling to get much better compression with the exact same image quality as the original JPEG image. However, in this case, you lose compatibility with a JPEG encoder since the format of the coefficients is not JPEG.
I'd think that the size decrease alone would sell the Porn Industry.
And that's if this new format would actually have advantages at these sizes. The factor doesn't need to remain constant in different resolutions. (And even if, we're talking about small pictures anyway, so if you save 1kb per preview pic, would this matter compared to the video stream bandwidth?)
http://en.wikipedia.org/wiki/Content_negotiation
Now that I think about it, there's probably a business opportunity for someone who handles such hosting issues for image-heavy web sites. The porn industry may seem sketchy, but they have a lot of money and a pressing need to keep overhead down.
Anybody got some statistics on browser distribution on a major *tube site? I guess we'll see a lot of Internet Explorer there, although it Chrome's "incognito" mode may have found some fans.
The trick will be to build enough mass to make it common enough for all the browsers to support WebP. I can see Firefox and Webkit adding it fairly quickly, so the real question is, if and when will Microsoft support it?
Better to insert random delays in responses to HTTP requests from suspected scrapers (or outright reject them).
> The WebP team is developing a patch to WebKit to provide native support for WebP in an upcoming release of Google Chrome.
So it will be available to all webkit browsers willing to accept the patch.
And hopefully attaching metadata to WebP images will be saner than it is for JPEGs.
As for metadata, the container format is based on RIFF, which consists of tagged binary chunks. Metadata chunks follow the image data, and consist of null-terminated strings. No word yet on whether or not you can use Unicode.
You should be able to use UTF-8 since it doesn't include embedded nulls.
Artifacts for lossy alpha compression are already, to some extent, well understood and dealt with, since compressing video game textures that contain an alpha channel is already done lossily using the DXTC compression formats.
Adoption by just Flickr and Facebook could push a new image format fast.
Google has much to gain since they archive a copy of indexed images. Hence their interest in "recompression".
Interesting move, Google
JPEG is a better format (than PNG) to use for photos and similar types of images, because it does an okay job of compressing them and because the compression artifacts are a lot less noticeable. However, JPEG is a really bad format for things like graphics with lots of flat colors or text, because there the compression artifacts are very easy to see. This image from Wikipedia comparing the two shows the difference: http://en.wikipedia.org/wiki/File:Comparison_of_JPEG_and_PNG...
PNG has the advantage of being lossless, and so it performs very well in some situations, but very poorly in others. Photos and images like them are an example of where PNG compresses poorly, because the . PNG actually does outperform JPEG (compression-wise) on some kinds of images though: those with lots of flat colors/text/gradients/etc., and those conveniently end up being the kinds of images where compression artifacts are really visible.
tl;dr: Use the right format for the job. PNG is not good at compressing photo-like images, but does really well at things like diagrams and vector graphics. JPEG is best-used for things like photos where compression artifacts aren't a huge deal.
If you're looking to learn more about how JPEG and PNG compress images, I recommend checking out Smashing Magazine's guides to JPEG and PNG optimization techniques. (I don't usually recommend Smashing Mag articles, but these are both good.) Both will give you some insight into how these things work.
http://www.smashingmagazine.com/2009/07/01/clever-jpeg-optim... http://www.smashingmagazine.com/2009/07/15/clever-png-optimi...
For example, see: http://www.hackerfactor.com/blog/index.php?/archives/250-Sho...
and
http://www.hackerfactor.com/blog/index.php?/archives/355-How...
It would be nice to see a more modern replacement, assuming the technology is better. That said, I haven't read enough about WebP yet to know if it actually fixes any of those problems with the JPEG format.
WebP _doesn't_ support this, but it really doesn't matter. The point of image files is for you to look at the image, not at the pixel values.
"In fact, of the 16 million colors in the 24-bit true-color pallet, JPEG can only store about 2.3 million colors. That's about 14% of the available color space."
and
"If JPEG stored images using RGB, then the Q tables would cause colors to diverge. For example, blue would have the most loss due to compression so images would appear more reddish and greenish. Instead, images are converted to a different color representation: luminance, chrominance red, and chrominance blue (YCrCb). Changing any one of these values alters the red, green, and blue components concurrently and prevents color divergence."
It is always best to think of reality as perfectly normal. Since the beginning, not one unusual thing has ever happened.
The goal is to become completely at home with [a world where people don't understand the difference between PNG and JPG in 2010]. Like a native. Because, in fact, that is where you live. - (paraphrased) http://lesswrong.com/lw/pc/quantum_explanations/
--
Calling reality "weird" keeps you inside a viewpoint already proven erroneous. Probability theory tells us that surprise is the measure of a poor hypothesis; if a model is consistently stupid - consistently hits on events the model assigns tiny probabilities - then it's time to discard that model. A good model makes reality look normal, not weird; a good model assigns high probability to that which is actually the case. Intuition is only a model by another name: poor intuitions are shocked by reality, good intuitions make reality feel natural. You want to reshape your intuitions so that the universe looks normal. You want to think like reality.
This end state cannot be forced. [..] But it will also hinder you to keep thinking How bizarre! Spending emotional energy on incredulity wastes time you could be using to update. It repeatedly throws you back into the frame of the old, wrong viewpoint. It feeds your sense of righteous indignation at reality daring to contradict you. - http://lesswrong.com/lw/hs/think_like_reality/
Well, that rules out Einstein.
Ultimately he was able to adapt his worldview to include the implications of quantum theory, but until then he was most certainly not in a state where he would "never understand physics."
It was a great essay, actually, just a terrible lede, as EY himself acknowledged in the comments.
Read more: http://news.cnet.com/8618-30685_3-20018146.html?communityId=...