Images

jpegoptim – optimize JPEG files from the command line

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
MozJPEGMozilla JPEG Encoder Project
pngquantUtility and a library for lossy compression of PNG images
SVGONode.js library and command-line application for optimizing SVG files
OxipngMultithreaded PNG optimizer, forked from Optipng
libjxlReference implementation of JPEG XL
libjpeg-turboJPEG image codec
QOIThe Quite OK Image Format
YOGAYummy Optimizer for Gorgeous Assets
pngcrushOptimizer for PNG files
jpegoptimOptimize JPEG files. Lossless and lossy compression available
OptiPNGAdvanced PNG optimizer
ECTFast and effective C++ file optimizer
CrunchLossy PNG image file optimization
zopflipngPNG optimisation tool using zopfli
JPEG ArchiveUtilities for archive JPEGs for long term storage
cavifConvert PNG and JPEG images to space-saving AVIF format
optimiztCLI image optimization tool
FlacaLosslessly compress GIF, JPEG and PNG images from the terminal
picoptMulti format lossless image optimize
tinifierCLI tool for compressing images using the TinyPNG API

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted