Mozilla Doubles Down on JPEG Encoding with mozjpeg 2.0 129
An anonymous reader writes: Mozilla today announced the release of mozjpeg version 2.0. The JPEG encoder is now capable of reducing the size of both baseline and progressive JPEGs by 5 percent on average (compared to those produced by the standard JPEG library libjpeg-turbo upon which mozjpeg is based). Mozilla today also revealed that Facebook is testing mozjpeg 2.0 to see whether it can be used to improve the compression of images on Facebook.com. The company has even donated $60,000 to contribute to the ongoing development of the technology.
Hard to get excited. (Score:2, Interesting)
Re:Hard to get excited. (Score:5, Insightful)
5% of image bandwidth saved for someone like Facebook is millions of dollars in operating expense. Get a clue.
Re:Hard to get excited. (Score:5, Insightful)
Re: (Score:2)
But what fraction of videos on Facebook are actually served by Facebook?
Most of what I see on Facebook is just links to external sites, and Facebook doesn't host it at all.
Re: (Score:1)
Re: (Score:2)
I am aware of that fact, yes.
However, never having seen or given a damn about Instagram ... I have no idea of it supports videos or not.
I would have to take extra steps to watch videos on the internet.
Like installing Flash or caring. Thus far, I've done a remarkable job of doing neither.
Re:Hard to get excited. (Score:4, Insightful)
aw crap, I have shamed myself.
Re: (Score:2)
Re:Hard to get excited. (Score:4, Insightful)
...low hanging fruit like cutting the 37% of their bandwidth used on videos by 20-30% by getting HEVC or VP9 really working well
If they wanted to tackle the low-hanging fruit, why not stop auto-playing video at all?
Re: (Score:2)
Ad revenue.
Re: (Score:2)
There is no ad revenue to be made from a video recorded by a friend starting to play automatically in my feed. It plays the video, not an ad.
Re: (Score:2)
Re: (Score:2)
No, it doesn't. I don't keep a Facebook tab open, mostly for that reason.
Re:Hard to get excited. (Score:4, Interesting)
And when Facebook is saying that only 1.48% of their bandwidth is going towards images. That puts said reduction 5% reduction at a new percent of 1.41% at the expense of increased CPU time to transcode all existing images, which is itself not free. It is a marginal savings, even for an organization the size of Facebook. It certainly adds up over time, which is great, but when there is really great low hanging fruit like cutting the 37% of their bandwidth used on videos by 20-30% by getting HEVC or VP9 really working well (would then be 26% total), then that is a way to save significant money not just in Bandwidth but in Disk Space for retention as well.
I deal with this sort of thing all day at work... you're not appreciating the scale of small adjustments.
For example: I recently got asked to approve an upgrade to internet explorer on an enterprise network.
I tested, and replied back that In one application, there was a 3 second delay in opening records. I declined approval and said this issue would have to get fixed before I could sign off on it.
Lots of managers had your attitude... it's only a 3 second delay!
So I had to present my reasoning in a meeting to explain:
We have approximately 1000 users that will be affected.
They each open, on average, 100 records per day.
They get paid an average of $15/hr
1000 users times 100 records = 100,000 records per day
Times 3 seconds = 300,000 seconds
Divided by 60 = 5000 minutes
Divided by 60 again = 83.33hrs
Times $15/hr = $1250
Not fixing that issue would cost the company roughly $1250 per day!
It's nearly a half a million dollar per year problem!
The fix is an increase in memory that would cost the company a 1 time charge of less than $20k.
Scale matters.
Re: (Score:1)
Re: (Score:2)
Luckily we don't care, because we're right.
Re: (Score:3)
Luckily we don't care, because we're right.
No, you are wrong. This kind of analysis was debunked before I got to college 30 years ago.
Just because something on the computer takes more or less time doesn't mean the user isn't adapting and overlapping other behaviors during those 3 seconds. Do a controlled experiment and come back when you have real data.
If your analysis is so great why aren't you advocating moving to technologies that take less time to bring up a record? Or pre-loading the next record, or anything to save your oh-so precious 300 seco
Re: (Score:2)
this kind of thing probably does help, but, yeah, not because of the magical linear time bank.
rather, something that keeps the user's attention often means less coffee breaks and chit-chat. waiting sucks.
Re: (Score:2)
3 seconds is long enough to be annoying, and short enough that an annoyed user will take longer than 3 seconds.
After the update, they'll waste 3 seconds each time. Then after a week, they'll use those 3 seconds to respond to a text on their cellphone, or an IM, or browse Facebook. So now th
Re: (Score:2)
If the user opens a record and waits 3 seconds then spends 30 seconds staring at the record or typing in it or talking to a customer, then the UI is messed up.
The computer is pretty idle in the subsequent 30 seconds and can be loading the next form in the background.
The people who use my PoS like it not because of it's neato use of python and ncurses. They like it because it responds instantly, is very non modal and never required more than two or three keystrokes to complete a transaction. If you are payin
Re: (Score:2)
Re: (Score:2)
Don't forget storage. Bandwidth is one thing, but image storage is a big deal for sites like FB. They often store multiple copies of each one (e.g. at different sizes) and then you also have copies cached on CDNs etc, which also costs money. 5% isn't going to make or break the company, but it's worth investigating.
Re: (Score:2)
Re: Hard to get excited. (Score:2)
so, apparently it's only worth $60k to them.
Re: (Score:2)
Why would they transcode all existing images? They could re-scale the thumbnails, but they wouldn't dare touch the originals unless they were so massive it made sense to give it a go.
Thumbnails for new images, ignoring existing ones, would more than pay off in just one more world cup, simply by replacing the existing implementation with this one.
So let me re-phrase. Mozilla open source people who can work on stuff because they want to, or can attribute some generic benefit, have teamed up with one of the
Re: (Score:1)
One fundamental difference. Improving the JPEG encoding used by Facebook would reduce their bandwidth use without requiring users or browser developers to do anything. Moving to H.265 or VP9 video encoding requires two things: that browsers add support for those video formats (some have already done that), and users upgrade to browser versions that include the support.
Most likely, Facebook would not transcode existing images; unless they saved the originally uploaded files (rather than the transcoded ones t
Re: (Score:3)
Any company that can save millions from something this small is so big that millions don't mean anything.
Re: Hard to get excited. (Score:2)
Even the biggest companies care about million(s). Reduction in operating expenses are always a good thing and if facebook can shave off million dollars a year without significant downsides they will take it gladly. Big companies didnt get big by being inefficient.
Re: (Score:2)
so donating 60k isn't really much,..
Re: (Score:3)
And yet, you're posting that on a web site which is mostly text.
I suspect a 5% decrease in size yields a very large percentage in bandwidth savings over time.
And there will always be people with slower links who will benefit from this.
Re:Hard to get excited. (Score:4, Funny)
I should use a smaller font then, I think.
Re:Hard to get excited. (Score:4, Funny)
Totally, going from 12pt to 10pt is a 20% savings. Got for a 6pt font and you can save 50%.
Add that to the 5% savings in the jpegs, and that's a lot of extra porn you can download before you fill the tubes.
Re: (Score:2)
Most videos (at least those linked to from meme-based image sites) are stored in GIF format, despite them taking twenty times the bandwidth/file size of the Youtube video they're based on.
Thus the best way to save space/bandwidth is to find a way to optimize compression of .GIF files.
Re: (Score:2)
Most videos (at least those linked to from meme-based image sites) are stored in GIF format...
While I don't disagree that the storing videos in GIF format is incredibly inefficient (and annoying), I somehow don't think that "meme-based image sites" are actually a significant fraction of internet bandwidth use compared to websites that use more standard video formats.
Re: (Score:2)
Most videos (at least those linked to from meme-based image sites) are stored in GIF format...
While I don't disagree that the storing videos in GIF format is incredibly inefficient (and annoying), I somehow don't think that "meme-based image sites" are actually a significant fraction of internet bandwidth use compared to websites that use more standard video formats.
Not to mention that our poster child for "meme-based image sites" now supports webm [4chan.org], and the format has become incredibly popular there.
Re: (Score:2)
Re: (Score:2)
Don't some video codecs use JPEG algorithms to encode the i-frames? This could translate in better video compression too.
Re: (Score:2)
Most of the pages on my web sites have a combination of PNG and JPEG content and almost no video. Smaller images means faster page load times for my users.
Re: (Score:2)
Yes. I've written a program that achieves a similar saving for PNGs and other lossless formats by making them very slightly lossy (It actually works by slightly adjusting the boundary between quantization bands, so no pixel ever changes value by more than a tiny, definable amount). What happens to it? No-one wants something like that, so it joins all my other dabbling in obscurity.
Re: (Score:2)
Perhaps it's because no one (importnat) has seen it? Put together a paper for the relevant ACM SIG conferences.
Re: (Score:2)
I'm just a hobbyist tinkerer, I have no qualifications between a not-very-good engineering diploma and no idea how to go about something like that.
Re: (Score:2)
But can your program beat the compression done by ImageOptim [imageoptim.com] and ImageAlpha [pngmini.com]?
Re: (Score:2)
No, but it works through different means: My thing + imageoptim > either alone.
Re: (Score:2)
But you can also do three types of colour reducing with ImageAlpha and then compress further with ImageOptim.
Tiny bumps in JPEG performance (Score:5, Insightful)
and still no merge of the working WebP patch that was proposed four years ago [mozilla.org] because NIH.
NIH, or once-bitten twice-shy? (Score:2)
Google has deliberately killed more technologies than Microsoft ever just let wither and die, and Mozilla has been burned by this more than once. At this point, I'd say it's quite reasonable to demand that Google provide some assurances that it's not going to flake out this time.
Re: (Score:1)
Google has deliberately killed more technologies than Microsoft ever just let wither and die, and Mozilla has been burned by this more than once.
Really? You just throw this assertion out there without spending the extra few seconds to name a few of these technologies? I'm really curious.
Re: (Score:1)
Re: (Score:2)
Google has killed services before that cost them money to continue operating, that's not the same thing as an open source codec at all.
Re: (Score:2)
Re:Tiny bumps in JPEG performance (Score:4, Interesting)
The reason we're not merging WebP in a hurry is because it's not very good. The study results linked to in the article show that WebP isn't much better than mozjpeg. (This is especially clear in the second part of the study where mozjpeg is tuned for SSIM.) On the other hand the study shows HEVC *is* much better than WebP/mozjpeg, so we know a much better format than WebP is technically available *now*. We can't simply adopt HEVC as is due to patent licensing issues, but we should be able to create an unencumbered format with similar or better performance (e.g. using VP9 or Daala as a base). It doesn't seem like a good idea to try to move to WebP when we know a better format is coming fairly soon (probably within a couple of years).
Re: (Score:3, Insightful)
Re: (Score:2)
We agree that alpha channel and animations are required features for any next-gen image format, but that doesn't change the analysis. It doesn't make sense to try to get WebP support everywhere for those features or for small compression gains, when in a couple of years or less we could introduce a new format with those features and big compression gains.
Re: (Score:1)
Re: (Score:1)
Re: (Score:2)
So what you are saying is that for the next few years (plus the past 4 years), WebP was available for you to use, better than mozjpeg is even now (and having a bunch of extra features like lossless compression, animations, alpha channel), but you will not use it because you are waiting
Re: (Score:2)
So what if WebP is only slightly better than mozjpeg? That isn't a reason not to include the patch. Even a slight improvement is worthwhile for site owners and people on limited speed connections. What reason is there NOT to include it?
Re: (Score:2)
I think the reason is that once it becomes widespread, all browsers will have to carry the support forever, not just distributing the code but also maintaining it (fixing security bugs etc.).
False equivalence (Score:2)
False equivalence. Facebook could use that $60k to fund/bribe inclusion of WebP, or maintain their own build of AssWeasel or whatever fork they want to call it.
Or they could entice users with "if you want to see pictures, click here". That works really well, and the facebook using billions might convert to something other than firefox.
Or, they could be supportive of this new tech and not use their massive market share to clobber open source into submission.
On the other side of the argument, NIH is a terri
Re: Worthless (Score:2)
Next week
Re: (Score:2)
Re: (Score:2)
Re:The future turned out to not be so cool (Score:5, Funny)
Correct, now is now.
But back then, now was then, and now was in the future. Of course, now 'then' was back then, and was the past. In the future, now will also be in the past, as will then. But by then, then will be now and then will be the present. The future present, not the current present.
So, soon, when now is later, the then now will be then, and now will still be in the past. But by then we won't have to worry, because it will be now, and I've already told you what happened.
Every now and then you need to remember which now, which then, how long until then is now, or how long ago then then was now.
Then you can say that you did know now what you knew then. Of course, when you say now then, it will be a different now than now, because it will be then.
It's all very complicated now, but by then it will make perfect sense.
Re:The future turned out to not be so cool (Score:5, Funny)
It's all very complicated now, but by then it will make perfect sense.
Colonel Sandurz: Try here. Stop.
Dark Helmet: What the hell am I looking at? When does this happen in the movie?
Colonel Sandurz: Now. You're looking at now, sir. Everything that happens now, is happening now.
Dark Helmet: What happened to then?
Colonel Sandurz: We passed then.
Dark Helmet: When?
Colonel Sandurz: Just now. We're at now now.
Dark Helmet: Go back to then.
Colonel Sandurz: When?
Dark Helmet: Now.
Colonel Sandurz: Now?
Dark Helmet: Now.
Colonel Sandurz: I can't.
Dark Helmet: Why?
Colonel Sandurz: We missed it.
Dark Helmet: When?
Colonel Sandurz: Just now.
Dark Helmet: When will then be now?
Colonel Sandurz: Soon.
Dark Helmet: How soon?
Re: (Score:2)
Corporal: Sir.
Dark Helmet: What?
Corporal: We've identified their location.
Dark Helmet: Where?
Corporal: It's the Moon of Vega.
Col. Sandurz: Good work. Set a course, and prepare for our arrival.
Dark Helmet: When?
Corporal: Nineteen-hundred hours, sir.
Col. Sandurz: By high-noon, tomorrow, they will be our prisoners.
Dark Helmet: WHOOOOOOO?!?!?
Re: (Score:1)
That's because those nerds were idiots.
Re: (Score:2)
Balderdash. (Score:2)
Any "nerd" who posited that bandwidth and storage concerns would be so totally irrelevant that we'd happily waste 10-20x as much of them for practically zero benefit was not so much a "nerd" as a total idiot. Having more bandwidth means you want to do more with it, not waste it for no reason.
Real "nerds" worth the cred understand that not only does lossy compression provide great results at small fractions of the sizes of the best lossless representations, but research into lossy compression also helps us u
oops (Score:2)
that'd be this link [sspnet.org]
that'll teach me to use preview esp. when I've been spending too much time on sites where the article discussions use bbcode
Re: (Score:2)
Re: (Score:2)
In 1994, more than a few of us were using dialup modems, and we wouldn't have believed you.
Or, more accurately, we wouldn't have been willing to wait 20 years for porn at that resolution.
Like so many things, people who say "in 20 years we'll be doing this" tend to get laughed at. Because the track record of people predicting what we'll be doing in 20 years is pretty sketchy.
Re: (Score:2)
Migrate to Australia, then. :(
The ghost of Uncle Rupert and Big Coal will still be dominating. Our current treasurer, Joe Quixockey, tilts at Canberran windmills.
Re: The future turned out to not be so cool (Score:2)
Not if they use pngcrush first.
Re: (Score:2)
I think the largest PNG file that I've been aware of was under 500KB.
I'm sure i've seen bigger.
A 1080p frame in uncompressed RGB is about 6MB. Afaict PNG gets of the order of a 3x ratio on photographic data so we are probablly talking a couple of megs of png if someone lifts a frame from a 1080p video.
You should be able to download that in less than 1/6th of a second with 24mb.
Unfortunately the intenet architecture doesn't handle short connections well. The TCP/IP stack doesn't know what the available bandwidth is so it has to be conservative initially. On high bandwidth but also high latency connections (e.g. user in europe, server in the USA or vic
And I just want Firefox not to shit itself (Score:2)
G+ is making FF crash its ass off these days. It would be a fun paranoid speculation to imagine that Google knows of bugs in FF which can be triggered with mundane code to make my browser asplode, but even if it were true it would be irrelevant because mundane code shouldn't blow up Firefox.
Re: (Score:2)
Comment removed (Score:4, Insightful)
Re: (Score:2)
Not a problem if you don't use G+. Certainly not my problem.
Re: (Score:2)
Re: (Score:2)
I find the web unusable without Adblock+, especially on my kiddie-grade 5Mbps max WISP connection. And Chrome's Adblock+ is still inferior to Firefox's, or I'd run chromium.
Re: (Score:2)
Re: (Score:3)
Re: (Score:2)
Or, alternately, Google introduces the suck faster than anybody else can counterbalance it.
Just sayin'.
Re: (Score:2)
G+ is making FF crash its ass off these days.
If only there was a simple workaround for this, but it's just not coming to me.
Formal verification (Score:2)
Why indeed would Mozilla waste their resources on this when stability and security on web clients ought to be their greater concern?
If it were up to me, I would start with self-contained date formats like JPEG that browsers handle frequently, and put that code through a formal verification process. Eventually, maybe even HTML rendering and the browser could be subject to formal verification. This could strengthen computer security dramatically.
Re: (Score:2)
The current extended support release of Firefox eats memory until the browser croaks or the offending tab is closed
Yeah, I wasn't going to go into that, but I actually tried that release hoping that an ESR release would be a good thing. But I guess I should have known better. I followed ESR on G+ for a while. That was a mistake. ;)
Save even more bandwidth for facebook users! (Score:2)
Take all landscape photos and crop 33% of the space on the left side and 33% on the right side. I see they already do this to widescreen videos taken on smart phones.
I just saved 66% of their bandwidth, and made the images more appealing to hipsters and guidos!
Re: (Score:2)
Bah, you could replace 33% of all Facebook pictures with cute cat photos, and nobody would even know the difference.
Secret new facebook image compression method! (Score:2)
Here is how their new compression method works. It reduces all images down to a single one or zero. If the bit read in is one, it display a picture of a cat. If it is zero, it displays a picture of Peter Griffin farting. And as a bonus, if no bit can be read, it displays the goatsex guy.
HSA decoder (Score:2)
AMD recently presented HSA-enabled jpeg decoding. That would also be an interesting addition. Make these shaders work a little...
http://developer.amd.com/resou... [amd.com]
Facebook could do more (Score:2)
No WebP in any web browser for iPad (Score:3)
Microsoft would have to fold if suddenly their browser didn't show images.
With Apple holding a monopoly on web browser engines on 36 percent of tablets, it arguably has room to play hardball with Facebook.
I'm not convinced webP is better (Score:2)
I'm not convinced webP is better, I've done a quick comparison and to my eyes JPEG beats it on like for like file sizes:
40k jpeg [imgur.com] vs 40k webP [imgur.com] (images converted to png for your viewing convenience)
Compared to the lossless original [imgur.com] (one of Google's own webP comparison images) the webP version has lost more chroma resolution, leading to desaturation in parts and blurring of strong colour details like the red arm band.
It would be nice as a replacement for PNGs with alpha channels though.
What we really need (Score:2)
What we really need is a new container format that combines the image data of a JPEG with the 8-bit transparency layer of a PNG image.
Re: (Score:2)
It exists, it's called JNG but support for it is poor :(
Re: (Score:2)
And even if support for it was added tomorrow, we probably couldn't use it for another decade or so because of Internet Explorer (insert version numbers still in use today).
Not JPEG2000? (Score:1)
As long as the renderers support it, and it doesn't come saddled with unFRANDly baggage, it will probably do fine.
However, Mozilla has a questionable track record [wikipedia.org], when it comes to support for standard media.
As a Web developer, it rankles me to have to store double the size of the video on my server, just so that stubborn developers can have their way.
How does it compare to JPEGmini? (Score:2)
JPEGmini [jpegmini.com] is a proprietary implementation of the same concept : fully compatible implementation of a JPEG compressor that does better than libjpeg at the cost of much higher CPU use.