PyTurboJPEG
A Python wrapper of libjpeg-turbo for decoding and encoding JPEG image.
Decision gist · record as of 2026-08-14
Yes. PyTurboJPEG is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers genuine performance benefits for JPEG-heavy workflows through libjpeg-turbo's optimized codec. The main requirement—installing libjpeg-turbo 3.0 or later as a system library—is a one-time setup cost. Install it if you need fast JPEG encoding and decoding, especially in batch or real-time image processing pipelines.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- libjpeg-turbo 3.0 or later must be installed as a system library before importing PyTurboJPEG; on macOS use `brew install jpeg-turbo`, on Linux/Windows download from the official libjpeg-turbo releases.
- Low install friction with a pure-wheel distribution, but requires libjpeg-turbo 3.0 or later as a system library—not a Python dependency.
- The package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute PyTurboJPEG freely provided you include the license notice.
last release 2026-07-14 (31 days) · last repo commit 2026-07-14 · 305 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 293,025 downloads/mo, #7,958 on PyPI
Alternatives
Verify before relying
pip install pyturbojpeg
import numpy
from pyturbojpeg import TurboJPEG
jpeg = TurboJPEG()
with open('input.jpg', 'rb') as f:
bgr_array = jpeg.decode(f.read())
with open('output.jpg', 'wb') as f:
f.write(jpeg.encode(bgr_array))- Whether the package's resource limits (max_pixels, max_memory, scan_limit) are suitable for your typical image sizes and untrusted input scenarios.
- Performance gains over standard libjpeg or other JPEG libraries in your specific use case.
- Compatibility with libjpeg-turbo versions prior to 3.0 (PyTurboJPEG 1.x may be required).
What it is and what it does
PyTurboJPEG is a Python binding to libjpeg-turbo that lets you decode JPEG files into numpy arrays and re-encode them with control over quality, color format, and subsampling. The package supports advanced operations like lossless cropping, scaling with quality preservation, YUV planar decoding, and in-place operations to reuse memory buffers. It handles multiple JPEG precisions and can extract header information without full decompression.
The main constraint is that libjpeg-turbo 3.0 or later must be installed separately as a system library. Once that is in place, the package integrates with numpy and works across Python 3.8 through 3.14. Resource limits are disabled by default to support large-image workflows, but can be configured when processing untrusted JPEGs. The API exposes both high-level convenience methods and lower-level control through flags and parameters.
Use it for
- Batch convert or re-encode large JPEG collections with custom quality settings or subsampling to reduce file size.
- Decode JPEG images directly into numpy arrays for computer vision pipelines without intermediate format conversions.
- Extract JPEG header metadata (dimensions, subsampling, colorspace) before deciding whether to decode the full image.
- Perform lossless JPEG operations like cropping or Huffman table optimization without re-encoding pixel data.
- Decode JPEG to YUV planes for video processing or direct GPU upload without RGB conversion overhead.
- Scale JPEG images on-the-fly during decode to reduce memory usage in memory-constrained environments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyTurboJPEG is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers genuine performance benefits for JPEG-heavy workflows through libjpeg-turbo's optimized codec. The main requirement—installing libjpeg-turbo 3.0 or later as a system library—is a one-time setup cost. Install it if you need fast JPEG encoding and decoding, especially in batch or real-time image processing pipelines.
Install
pyturbojpeg on PyPI
Before you install
Low install friction with a pure-wheel distribution, but requires libjpeg-turbo 3.0 or later as a system library—not a Python dependency. The package is actively maintained with a recent release and no known vulnerabilities.
libjpeg-turbo 3.0 or later must be installed as a system library before importing PyTurboJPEG; on macOS use `brew install jpeg-turbo`, on Linux/Windows download from the official libjpeg-turbo releases.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute PyTurboJPEG freely provided you include the license notice.
Quickstart
pip install pyturbojpeg
import numpy
from pyturbojpeg import TurboJPEG
jpeg = TurboJPEG()
with open('input.jpg', 'rb') as f:
bgr_array = jpeg.decode(f.read())
with open('output.jpg', 'wb') as f:
f.write(jpeg.encode(bgr_array))
Verify before relying
- Whether the package's resource limits (max_pixels, max_memory, scan_limit) are suitable for your typical image sizes and untrusted input scenarios.
- Performance gains over standard libjpeg or other JPEG libraries in your specific use case.
- Compatibility with libjpeg-turbo versions prior to 3.0 (PyTurboJPEG 1.x may be required).
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 31 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 293,025 / month, #7,958 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: pyturbojpeg-2.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “libjpeg-turbo python wrapper”
- PyTurboJPEGPyTurboJPEG wraps libjpeg-turbo to decode and encode JPEG images…
- turbojpegPython bindings for libjpeg-turbo that provide lossless JPEG…
- kornia-rskornia-rs provides low-level computer vision operations—image I/O,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Graphics packages
Pillow adds image processing capabilities to Python, providing file format support, efficient pixel data handling, and image manipulation operations.
Install it if you need to work with images in Python—it is the de facto standard for this task.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Enables matplotlib figures to display inline directly within Jupyter notebooks and IPython environments instead of in separate windows.
PyMuPDF extracts, renders, converts, and manipulates PDF and other document formats (XPS, EPUB, images, Office files via Pro) with high performance, providing text, tables, images, and metadata with precise layout information.
The AGPL license requires careful review if you are building proprietary software—commercial licensing is available from Artifex.
pypdfium2 is a Python binding to PDFium that enables PDF rendering, inspection, manipulation, and creation through a ctypes interface to Google's PDFium library.
Install it if you need PDF rendering, inspection, or manipulation in Python; the medium install friction is offset by comprehensive platform support.
Altair is a declarative Python library for creating interactive statistical visualizations by writing simple, readable code that compiles to Vega-Lite specifications.
See also simplejpeg · turbojpeg · pillow-jxl-plugin · pylibjpeg-libjpeg · pylibjpeg · pyjpegls · qoi · pylibjpeg-openjpeg · edk2-pytool-library · img2pdf