MozJPEG 3.0
calendar.perfplanet.com
calendar.perfplanet.com
Most competing file formats seem to beat JPEG by only a slim margin, and what I've read on arithmetic encoding suggests it gives a ~5-10% gain, which would make that difference slimmer still, perhaps vanishing into the uncertainty of the usefulness of these quality benchmarks. Of course, there would be inertia to overcome to support it, as with a new format, but recompiling everyone's libjpeg is surely less work than adding support for whole new file formats. At the very least, it seems there might be a better effort/payoff ratio.
I was using the very first release of the source back in the stone age or so. We took passport photo images with a video camera at reasonably high resolution and then scaled them down and compressed with PCX to save on storage.
Quality after compression was absolutely terrible.
Then Tom Lane came along with libjpeg and suddenly the quality was better than what we could print!
Thanks for the writeup and your work on this release, Kornel!
Also, I have a little script that uses imagemagick to watermark an image and then create a resized image smaller image for web. Does mozjpeg's cjpeg support 48bpp png or is there some better way to no lose some detail due to rounding by avoiding going from 24-bit RGB out of imagemagick to YCbCr?
Original - 327kb - http://i.imgur.com/DTxTcLp.jpg
MozJPEG - 127kb - http://i.imgur.com/jVESWGS.jpg
Stared at both side by side and really struggled to tell the difference. Great job!
Sorry WebP is great but I just don't see it getting adapted unless all browsers get on board as well as big software. JPEG is practically a household name, photographers, artists, insta-grammers,all know what it is and short of a mild revolution I just don't see it.
There are more in the fourth column.
https://github.com/mozilla/mozjpeg/issues/139
I said in another comment that we'd release 3.0 tomorrow, we'll probably hold up the release to investigate this.
They already fixed the bug. I'm impressed.
@joshmoz Hopefully, you can re-run the image and share it with us in case we can find something else. :D
http://i.imgur.com/2wAcBdL.png (23.43 KB)
For nicer looking images, scan as grayscale and then use Photoshop's Image -> Adjustments -> Curves to turn everything almost-white to white and everything almost-black to black:
http://i.imgur.com/ktj8WkE.png
Alternatively, do a high-DPI 1bit scan, convert the document to 8bit, and then scale it down.
E.g. when you go from 1600 DPI to 100 DPI, you have 16x16 1bit pixels per 8bit pixel. The result will look smooth and crispy.
The fact that a single difference in a configuration bit (lossy/non-lossy) can introduce subtle and easy-to-miss errors (to the point that this went unnoticed by Xerox QA and thousands of their customers!) is an indication to me that while JBIG2 might be superior in terms of the compression it offers, it's not a solution I would use without very serious consideration and deliberation.
Just to make this more clear: if you borked the compression setting on jpeg, you get smeared images. If you bork the lossy/nonlossy flag on JBIG2, you get images that look great but may have a random letter or digit swapped for another.
[0] http://www.theregister.co.uk/2013/08/06/xerox_copier_flaw_me...
Hopefully this will find its way into image authoring tools.
http://johncostella.com/unblock/
This isn't something that can be done on the encoding side, so it's out of scope of MozJPEG.
I do think it may be worthwhile to spec a backwards-compatible extension for decoders that adds deblocking.
I’ve been using JPEGMini trial [http://www.jpegmini.com/] for a while. How does this compare?
Original: 250kB http://files.sina.is/original.jpg
Compressed by JPEGmini Lite: 133kB http://files.sina.is/jpeg-mini.jpg
Compressed by MozJPEG 3.0 @ Medium: 82kB http://files.sina.is/moz-medium.jpg
Compressed by MozJPEG 3.0 @ High: 141kB http://files.sina.is/moz-high.jpg
Here is an overview of this idea: http://jmvalin.ca/video/spie_pvq_abstract.pdf
I'm not sure though how exactly it translates into still images compression efficiency. For video they do plan to eventually beat HEVC both on quality and algorithmic delay.
I'm currently working on a project that needs alpha channels. I've been optimizing the images with pngcrush, which helped (interestingly, images put out with Adobe products where already pretty optimized, but I'm generating thumbnails locally with sips, where pngcrush often saves 60+%).
Still, for photographic images, file size often remains multiple times larger than what I'd expect from a high-quality JPEG.
I do. Lossy PNGs work great for images with not a lot of colors. I use pngquant and optipng a lot in my work to compress a lot of PNG images with practically no visual quality loss.
For very colorful images, lossy (quantized & dithered) PNGs just don't work, though. They just end up looking nasty with larger filesizes than what high quality JPG gives you.
@echo off
set batchdir=%~d0%~p0
:start
"%batchdir%pngquant.exe" --ext .q.png --force --verbose 256 %1
"%batchdir%optipng.exe" -force -o4 -out "%~dpn1.opt.png" "%~dpn1.q.png"
del "%~dpn1.q.png"
shift
if NOT x%1==x goto start
rem pause -quant-table 2
etcOn a totally unrelated note, Denny, the dude that dropped the first comment on that post, is not a stand-up guy.
* Lossy compression with alpha channels. * Efficient lossless compression of photo-like images. * Efficient compression of photo-like and diagram-like images in the same format (and in the same image, e.g. screenshots containing photos). * Good lossy compression of diagram-like images.
No.
I did, last summer, converted all images (35K) on my NSFW hobby site (check profile) to WebP with no jpeg fallback or shabby javascript decoder (which don't work on very high res images), and haven't looked back.
On my journey to 1000ms-to-glass with a site like mine, I'm going to go with the format that gives me dramatic size savings, thank you Google.
That said, I can see how it benefits Firefox users not to be able to render WebP... sigh.
It would be helpful if 4chan followed my lead by at least allowing users to post WebP with something like mod_pagespeed running.
I made a sort of Google+ companion to the site which I'd bump them onto but I still haven't gotten the hang of not getting banned.
By the way, it's remarkable when running an image-heavy site how much bot/mass downloader traffic relative to humans vanish when turning away Firefox user agents.
As far as I've seen, testing has shown that WebP is not dramatically better than JPEG, as long as you're using a clever encoder (like MozJPEG, which is what we're talking about). If you have evidence to the contrary, I'm sure the MozJPEG guys would appreciate a test-case!
> That said, I can see how it benefits Firefox users not to be able to render WebP... sigh.
Instead of spending energy on dubious WebP, Mozilla spends energy on improving JPEG (which benefits everybody now) and Daala (which will hopefully benefit everybody eventually). I think it's a pretty sensible trade-off.
• There's a draft for gracefully-degrading JPEG eXTensions that add all the features you want http://www.jpeg.org/jpegxt/index.html (by encoding classic JPEG + residual image hidden in JPEG metadata).
WebP is a bit of a hack: it has JPEG-like algorithm for photos (VP8) and a custom PNG-like algorithm for lossless. Technically it's not much different than having JPEG and PNG and using same filename extension for both.
JPEG 2000 and JPEG XR have truly scalable algorithm that can support lossy and lossless.