// Patrick Louis

MozJpeg Correlation

Hello fellow readers,

I’ve wanted to try mozjpeg since it came out. After getting it installed I was surprised by how awesome the compression is.

To get a bit of an idea of mozjpeg, it is a fork of the libjpeg. When installed, it replaces the original cjpeg with theirs (works only on Unix). Here’s a nice introduction to it.

The redundant questions are:

  • What would be the best compression ratio to use?
  • Should I use progressive JPEG or non-progressive, what’s the difference?

The second one is an easy guess. Progressive JPEG gives a smaller output but it’ll render in subsequent scan, from low quality to high quality. I personally find this extremely annoying when used on the web.

And thus, I’ve started a mini-project to gather statistics on the first question. I’ve hacked around a script that’ll open 2 images, one being the original, the other a compressed one, and then asks if the compression is satisfying. It re-iterates and compress the next image with a higher ratio until the user is unsatisfied. At this point it stores the last best compression used and also keeps the last best image.

I’m hoping that after gathering a lot of inputs the program will be able to guess, if there’s a correlation between the size of the image and the compression ratio, what compression is best to use.

Here’s the link to the project on Github.

Cheers!




If you want to have a more in depth discussion I'm always available by email or irc. We can discuss and argue about what you like and dislike, about new ideas to consider, opinions, etc..
If you don't feel like "having a discussion" or are intimidated by emails then you can simply say something small in the comment sections below and/or share it with your friends.