All formats

JPEG libraries

Open-source libraries that decode and encode JPEG files. Almost every image library uses libjpeg-turbo underneath (Pillow, OpenCV, libvips, ImageMagick, GD, Skia); Go, Rust and .NET’s ImageSharp have their own decoders. Things that differ between libraries: whether they apply the Exif orientation, whether they keep metadata when saving, and whether they can write progressive JPEG and choose chroma subsampling.

Language Library Read Write Notes
C/C++ libjpeg-turbo yes yes the standard JPEG codec, SIMD-accelerated, libjpeg and TurboJPEG APIs
C/C++ mozjpeg yes yes libjpeg-turbo fork that makes smaller files, slower encoding
C/C++ stb_image yes yes single header, public domain, baseline-only encoder
C# ImageSharp yes yes pure managed code, Exif, progressive; Six Labors Split License
C# SkiaSharp yes yes wrapper of Google’s Skia, fast decode and resize
C# Magick.NET yes yes ImageMagick for .NET, every JPEG option
C# MetadataExtractor metadata no Exif, XMP, IPTC, ICC reading
Java ImageIO yes yes built into the JDK
Java TwelveMonkeys yes yes ImageIO plugin: CMYK, YCCK, broken files
Java metadata-extractor metadata no the standard Exif reader for Java
Go image/jpeg yes yes standard library, baseline encoder, no metadata
Go imaging yes yes resize, crop, auto-orientation
Python Pillow yes yes the standard Python imaging library, Exif
Python OpenCV yes yes images as NumPy arrays
Ruby ruby-vips yes yes fast, low memory thumbnails, libvips binding
Ruby MiniMagick yes yes wraps ImageMagick command line
Rust image yes yes high-level, many formats
Rust zune-jpeg yes no fast pure-Rust decoder used by image
PHP GD yes yes bundled with PHP, Exif via the exif extension
PHP Imagick yes yes ImageMagick extension
PHP Intervention Image yes yes fluent API over GD, Imagick or libvips

By language#