JPEG Compression

Manage your Photos: JPEG Photo Compression


All three tools are CLI based. Why do we advocate CLI tools so strongly? It’s partly because of the availability of batch processing. For example, let’s say your photo collection is stored in ~/Photos/ with many sub-directories. You can process all the images with a single shell command ran from the Photos directory.

$ find . -name "*.jpg" -exec bash -c 'file="{}"; guetzli --quality 84 "$file" "${file/%ext/out}"' \;

The example command uses Guetzli, but you can easily adapt it for the other tools.


Guetzli offers excellent compression and excellent quality output but makes a huge sacrifice in terms of encoding time. Even if you have a powerful PC with lots of cores, you’ll need copious amounts of RAM to encode multiple images simultaneously.

Guetzli doesn’t support progressive image loading (where images load from blurry to sharp, instead of top to bottom) and only supports sRGB.

There is a third-party GUI available for Guetzli which uses Qt, but this has few followers.

Support: Qt based GUI
Developer: Google
License: Apache License 2.0


MozJPEG is our recommended JPEG encoder. Like Guetzli it offers perfect backward compatibility with JPEG files, offers excellent compression ratios without taking a year and a day to compress files. It strikes a perfect balance.

Developer: Mozilla
License: IJG (Independent JPEG Group) License, Modified (3-clause) BSD License, zlib License


Lepton is a fully streamable format, meaning the decompression can be applied to any file as that file is being transferred over the network. It provides lossless, bit-exact storage for any type of photo, for archival purposes or for serving live.

Lepton is excellent at compressing large images. It offers good compression ratios together with blindingly fast encoding. But you cannot view images without the software which can be inconvenient. But if you insist on lossless compression, it’s the best JPEG tool available.

Support: Blog
Developer: Dropbox
License: Apache License 2.0

There are other good open source JPEG encoders including libjpeg, libjpeg-turbo, and jpegoptim.

Pages in this article:
Page 1 – Introduction / Installation
Page 2 – Guetzli – Compression chart
Page 3 – Guetzli – Time chart
Page 4 – MozJPEG – Compression chart
Page 5 – MozJPEG – Time chart
Page 6 – Lepton – Compression chart
Page 7 – Lepton – Time chart
Page 8 – Summary

Popular series
Guide to LinuxNew to Linux? Read our Linux for Starters series. We start right at the basics and teach you everything you need to know to get started with Linux.
Free and Open Source SoftwareThe largest compilation of the best free and open source software in the universe. Each article is supplied with a legendary ratings chart helping you to make informed decisions.
ReviewsHundreds of in-depth reviews offering our unbiased and expert opinion on software. We offer helpful and impartial information.
Alternatives to Proprietary SoftwareReplace proprietary software with open source alternatives: Google, Microsoft, Apple, Adobe, IBM, Autodesk, Oracle, Atlassian, Corel, Cisco, Intuit, and SAS.
Linux Around The WorldLinux Around The World showcases events and usergroups that are Linux-related. This is a new series.
DockerGetting Started with Docker helps you master Docker, a set of platform as a service products that delivers software in packages called containers.
System ToolsEssential Linux system tools focuses on small, indispensable utilities, useful for system administrators as well as regular users.
ProductivityLinux utilities to maximise your productivity. Small, indispensable tools, useful for anyone running a Linux machine.
Home ComputersHome computers became commonplace in the 1980s. Emulate home computers including the Commodore 64, Amiga, Atari ST, ZX81, Amstrad CPC, and ZX Spectrum.
Now and ThenNow and Then examines how promising open source software fared over the years. It can be a bumpy ride.
Linux at HomeLinux at Home looks at a range of home activities where Linux can play its part, making the most of our time at home, keeping active and engaged.
Linux CandyLinux Candy reveals the lighter side of Linux. Have some fun and escape from the daily drudgery.
Android AppsBest Free Android Apps. We showcase free Android apps that are definitely worth downloading. There's a strict eligibility criteria for inclusion in this series.
Programming BooksThese best free books accelerate your learning of every programming language. Learn a new language today!
Programming TutorialsThese free tutorials offer the perfect tonic to our free programming books series.
Stars and StripesStars and Stripes is an occasional series looking at the impact of Linux in the USA.
Share this article

One comment

  1. According to the tests I made some years ago to be able to store efficiently invoices and other enterprise documents scans into a document management software without artifacts, even on very small letters, tests that I also extended to web sites pictures processing, here is what I found :

    using GIMP as the graphic manipulation program with a :
    * progressive .jpg encoding for slow connections enabled,
    * 4:4:4 Subsampling method,
    * Floating-point for the DCT method,
    * only exif data kept (no thumbnail or other orientation/dimensions system)
    *** and the most important feature : image colors indexed into a 256 colors optimized palette,

    the threshold not to cross to be absolutely sure there will be no artifacts in the final picture, nor color problems (except, of course, with gradations, that do not fit in this process) is : 65 %.

    My 2¢

Share your Thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.