turbojpeg
Python bindungs for libjpeg-turbo using pybind11
What it is and what it does
turbojpeg is a thin Python wrapper around libjpeg-turbo's C API, built with pybind11. It exposes three core functions: transform (for lossless JPEG operations like rotation), compress (to encode image arrays as JPEG), and decompress (to decode JPEG data). The package is designed for developers who need fast JPEG processing and want direct access to libjpeg-turbo's performance and feature set.
The package ships precompiled wheels for multiple platforms (Windows, macOS, Linux), reducing installation friction compared to building from source. However, it has not been updated since its latest release on 2023-08-06, and the license is not clearly declared in the metadata. It carries no runtime dependencies beyond the bundled libjpeg-turbo binaries.
Use it for:
- Rotate or flip JPEG images losslessly without recompression artifacts
- Compress numpy arrays to JPEG format with quality and sampling control
- Decompress JPEG files into raw image data for processing pipelines
- Batch process images using arithmetic coding or other TurboJPEG features
- Integrate high-performance JPEG operations into image processing workflows
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python bindings for libjpeg-turbo that provide lossless JPEG transformation, compression, and decompression using the TurboJPEG C API Version 3.
Yes, if you need direct access to libjpeg-turbo's JPEG operations and your platform is among those with precompiled wheels. Verify the license first. The aging maintenance status (no releases since 2023-08-06) is a minor concern if the functionality is stable and meets your needs, but monitor for security issues or compatibility problems with future Python versions.
Install
turbojpeg on PyPI
pip
pip install turbojpeguv
uv add turbojpegpoetry
poetry add turbojpegInstalling turbojpeg
Before you install
Medium install friction due to compiled wheels for multiple platforms (Windows, macOS, Linux variants). Package is aging—last release was over a year ago, though the repository remains active with recent commits. No runtime dependencies to manage.
License in practice
License treatment is unclear; the package metadata does not specify an SPDX identifier or raw license text. Verify the actual license before use in proprietary or restricted contexts.
Quickstart
import turbojpeg
with open("image.jpg", "rb") as fr:
img_data = fr.read()
img_data_rot = turbojpeg.transform(img_data, op=turbojpeg.OP.ROT90)
with open("image-rotated.jpg", "xb") as fw:
fw.write(img_data_rot)
Requires libjpeg-turbo binaries; precompiled wheels are provided for Windows (32/64-bit), macOS (x86_64/arm64), manylinux, and musllinux platforms. Requires Python >=3.7.
Verify before relying
- Whether the unclear license is compatible with your project's licensing requirements
- Performance characteristics compared to other JPEG libraries in your use case
- Whether all platform wheels are actively tested and stable
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,104 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,810/month — #13,247 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: turbojpeg-0.0.2-cp310-cp310-macosx_10_9_x86_64.whl; turbojpeg-0.0.2-cp310-cp310-macosx_11_0_arm64.whl; turbojpeg-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; turbojpeg-0.0.2-cp310-cp310-musllinux_1_1_x86_64.whl; turbojpeg-0.0.2-cp310-cp310-musllinux_1_2_x86_64.whl; turbojpeg-0.0.2-cp310-cp310-win32.whl; turbojpeg-0.0.2-cp310-cp310-win_amd64.whl; turbojpeg-0.0.2-cp311-cp311-macosx_10_9_x86_64.whl; turbojpeg-0.0.2-cp311-cp311-macosx_11_0_arm64.whl; turbojpeg-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; turbojpeg-0.0.2-cp311-cp311-musllinux_1_1_x86_64.whl; turbojpeg-0.0.2-cp311-cp311-musllinux_1_2_x86_64.whl; turbojpeg-0.0.2-cp311-cp311-win32.whl; turbojpeg-0.0.2-cp311-cp311-win_amd64.whl; turbojpeg-0.0.2-cp312-cp312-macosx_10_13_x86_64.whl; turbojpeg-0.0.2-cp312-cp312-macosx_11_0_arm64.whl; turbojpeg-0.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; turbojpeg-0.0.2-cp312-cp312-musllinux_1_2_x86_64.whl; turbojpeg-0.0.2-cp312-cp312-win32.whl; turbojpeg-0.0.2-cp312-cp312-win_amd64.whl
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
PyTurboJPEGPyTurboJPEG wraps libjpeg-turbo to decode and…
permissive · top 15,000 on PyPI
pyjpeglsEncodes and decodes image data using the…
permissive · top 15,000 on PyPI
pylibjpeg-openjpegDecodes and encodes JPEG 2000 images to and…
permissive · top 15,000 on PyPI
pylibjpeg-libjpegDecodes JPEG and JPEG-LS images to NumPy…
copyleft · top 15,000 on PyPI
pylibjpegDecodes and encodes JPEG, JPEG-LS, JPEG 2000,…
permissive · top 15,000 on PyPI
lzallrightlzallright provides Python bindings to compress…
permissive · top 15,000 on PyPI
python-lzfProvides Python bindings to the liblzf…
permissive · top 15,000 on PyPI
python-neo-lzfProvides fast compression and decompression of…
permissive · top 15,000 on PyPI
lzfsePython bindings for the LZFSE reference…
permissive · top 5,000 on PyPI
etcpakCompresses image data into GPU-friendly texture…
permissive · top 15,000 on PyPI