libjpeg-turbo compresses and decompresses JPEG images using SIMD on common CPUs. It provides the traditional libjpeg API, the TurboJPEG API, colorspace extensions, and a Java interface.
Overview
libjpeg-turbo is a JPEG image codec that uses SIMD instructions to speed baseline and progressive JPEG compression and decompression on systems with common CPU architectures. The authors report substantial speedups over libjpeg on those systems and competitive performance elsewhere through optimized Huffman coding.
Two APIs are included: TurboJPEG for straightforward in-memory compress and decompress workflows, and the industry-standard libjpeg API for fuller control. The implementation is API/ABI-compatible with libjpeg v6b and can optionally emulate libjpeg v7 and v8 ABIs. Colorspace extensions allow compressing from and decompressing to buffers in BGR, RGBX, XBGR, XRGB, and alpha-aware layouts.
The project originated from SIMD-enhanced libjpeg work and later became a standalone effort to make fast JPEG code broadly available. It serves as an ISO/IEC and ITU-T reference implementation of the JPEG standard. Optional builds can emulate newer libjpeg ABIs; some libjpeg v7+ features such as SmartScale and certain DCT scaling modes are intentionally not supported.
Official binaries, package repositories, and documentation are available, with both C and Java usage paths. Windows behavior for dynamically linked jpegmemsrc and jpegmemdest is called out separately from typical Unix lazy symbol resolution.
Key features
- SIMD-accelerated JPEG compress and decompress
- libjpeg and TurboJPEG APIs
- Colorspace extensions for RGB/BGR layouts
- libjpeg v6b compatibility with optional v7/v8 ABI
- In-memory source and destination managers
- IDCT scaling and arithmetic coding support
- Java interface cited on project site
- ISO/ITU-T JPEG reference implementation role
Use cases
- Fast JPEG handling in native applications
- In-memory image pipelines via TurboJPEG
- Drop-in libjpeg replacement with SIMD
- Non-RGB pixel buffer JPEG conversion
- Java programs needing accelerated JPEG