From TheAlmightyGuru
Jump to: navigation, search
JPEGOptim in command line.

JPEGOptim is a free open source program written in C for Linux and Windows that optimizes the compression of JPEG images. It was developed by Timo Kokkonen and first released in 1996. The program has several options, most of which require a basic understanding of image formats and compression, but the default options will almost always yield better results than a typical graphic program. The program can be run to optimize the Huffman tables (and retain the original quality), or re-encode the image at a higher compression level, and lose quality.

Although the developer is still adding to the program, he doesn't maintain builds, even for simpler platforms like Windows, so you have to compile the program from source to get the latest version, although SourceForge still has older binaries available.

I no longer use this program as ImageMagick offers superior optimization. To use the program with its default settings, simply drag and drop JPEG images onto the jpegoptim.exe file.


I found this program in the late-2010s while looking for a JPEG equivalent of PNGOut. I use it for all the images I upload to my web sites and for large graphic projects I've done in order to save space. After discovering that ImageMagick outperforms it, I stopped using the program.


The test image.

I've performed some compression tests using the sample PNG image to the right. In order to test various graphic formats at once, the sample image includes a photograph, text, gradients, checkerboards, and a screenshot. At a color depth of 24-bits per pixel, the uncompressed image is 786,432 bytes.

In this first test, I used the built-in JPEG compressor of Corel Photo-Paint X7 to save JPEGs of varying degrees of quality. In the second test, I used JPEGOptim's lossless optimizer to further compress the JPEGs. In the third test, I sent the original PNG image directly to JEPGOptim's lossy optimizer to compress them even better.

Original Render Corel Photo-Paint X7 - JPEG - 100%.jpg Corel Photo-Paint X7 - JPEG - 85%.jpg Corel Photo-Paint X7 - JPEG - 50%.jpg Corel Photo-Paint X7 - JPEG - 25%.jpg Corel Photo-Paint X7 - JPEG - 10%.jpg
JPEG Quality 100% 85% 50% 25% 10%
Corel Photo-Paint Size 238,998 98,303 59,927 43,675 30,242
JPEGOptim Lossless 193,504 91,039 55,420 39,325 30,242
JPEGOptim Lossy N/A 89,725 54,912 39,167 24,595
JPEGOptim Render N/A JPEGOptim Test - 85%.jpg JPEGOptim Test - 50%.jpg JPEGOptim Test - 25%.jpg JPEGOptim Test - 10%.jpg