jpegoptim is a command-line utility for optimising JPEG images. It can reduce file size without changing image quality by optimising the JPEG data structures, or perform lossy recompression when a smaller target size or quality setting is required.
The program is suited to batch processing and scripting. It can read images from files or standard input, write to standard output, process file lists and use multiple worker processes. It also gives detailed control over JPEG metadata and whether images remain progressive or non-progressive.
jpegoptim works with libjpeg and is also compatible with libjpeg-turbo and MozJPEG.
This is free and open source software.
Key Features
- Performs lossless JPEG optimisation by default, avoiding an additional quality-reducing encode cycle.
- Supports lossy recompression when a maximum quality or target file size is specified.
- Can retain the source image’s progressive or non-progressive mode, or explicitly convert between the two.
- Processes multiple files in parallel with a configurable number of workers.
- Can read filenames from a file or standard input for large scripted jobs.
- Reads image data from standard input and can send optimised JPEG data to standard output.
- Provides an automatic mode for selecting an appropriate optimisation strategy without repeatedly recompressing its own lossy output.
- Can retry images when an initial optimisation does not meet the selected criteria.
- Offers extensive marker handling for EXIF, IPTC, ICC, XMP, comments, JFIF and other JPEG metadata.
- Can strip all metadata while selectively retaining chosen marker types.
- Supports preserving permissions and timestamps on optimised files.
- Offers destination-directory output, overwrite controls and threshold-based processing.
- Provides CSV output suitable for collecting results in scripts and reports.
- Supports JPEG arithmetic coding when built with a compatible JPEG library and the relevant build option enabled.
- Can preserve extra bytes occurring after the JPEG end marker when those trailing data are significant to a workflow.
Website: github.com/tjko/jpegoptim
Support:
Developer: Timo Kokkonen
License: GNU General Public License v3.0
jpegoptim is written in C. Learn C with our recommended free books and free tutorials.
Related Software
| Console Based Image Compression Tools | |
|---|---|
| MozJPEG | Mozilla JPEG Encoder Project |
| pngquant | Utility and a library for lossy compression of PNG images |
| SVGO | Node.js library and command-line application for optimizing SVG files |
| Oxipng | Multithreaded PNG optimizer, forked from Optipng |
| libjxl | Reference implementation of JPEG XL |
| libjpeg-turbo | JPEG image codec |
| QOI | The Quite OK Image Format |
| YOGA | Yummy Optimizer for Gorgeous Assets |
| pngcrush | Optimizer for PNG files |
| jpegoptim | Optimize JPEG files. Lossless and lossy compression available |
| OptiPNG | Advanced PNG optimizer |
| ECT | Fast and effective C++ file optimizer |
| Crunch | Lossy PNG image file optimization |
| zopflipng | PNG optimisation tool using zopfli |
| JPEG Archive | Utilities for archive JPEGs for long term storage |
| cavif | Convert PNG and JPEG images to space-saving AVIF format |
| optimizt | CLI image optimization tool |
| Flaca | Losslessly compress GIF, JPEG and PNG images from the terminal |
| picopt | Multi format lossless image optimize |
| tinifier | CLI tool for compressing images using the TinyPNG API |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.