pylibjpeg-libjpeg
A Python wrapper for libjpeg, with a focus on use as a plugin for for pylibjpeg
What it is and what it does
pylibjpeg-libjpeg is a Python wrapper around Thomas Richter's libjpeg library, designed primarily as a plugin for the pylibjpeg ecosystem and pydicom. It decodes JPEG and JPEG-LS images into NumPy arrays, supporting both standalone use and integration with DICOM workflows. The package handles multiple DICOM transfer syntaxes including JPEG Baseline, JPEG Extended, JPEG Lossless, and JPEG-LS variants.
The package is built on compiled C++ bindings and ships with pre-built wheels for modern Python versions (3.10–3.13) across Linux, macOS, and Windows, reducing installation complexity for most users. It depends only on NumPy and is maintained as part of the pydicom project. Encoding is not currently supported; the focus is on decoding medical and standard JPEG formats.
Use it for:
- Decompress JPEG-encoded DICOM medical images within a pydicom workflow
- Decode JPEG-LS lossless images for archival or diagnostic imaging applications
- Standalone conversion of JPEG files to NumPy arrays for scientific image processing
- Plugin integration with pylibjpeg to support multiple JPEG codecs in a single application
- Batch processing of DICOM datasets with JPEG-compressed pixel data
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Decodes JPEG and JPEG-LS images to NumPy arrays, with support for multiple DICOM transfer syntaxes and integration with pylibjpeg and pydicom.
Yes, if you need JPEG or JPEG-LS decoding in a DICOM or scientific imaging context. The package is actively maintained, has no known vulnerabilities, and offers broad platform support. The GPL v3.0 copyleft license is a hard blocker for closed-source projects; open-source and research users should install without hesitation. Encoding is not supported, so it is not suitable for JPEG generation workflows.
Install
pylibjpeg-libjpeg on PyPI
pip
pip install pylibjpeg-libjpeguv
uv add pylibjpeg-libjpegpoetry
poetry add pylibjpeg-libjpegInstalling pylibjpeg-libjpeg
Before you install
Pre-built wheels available for Python 3.10–3.13 on Linux, macOS, and Windows reduce install friction. Repository is active with recent commits. Medium install friction reflects compiled C++ bindings; development builds require Microsoft C++ Build Tools on Windows.
License in practice
Licensed under GPL v3.0 (copyleft). Any derivative work or distribution must comply with copyleft obligations; proprietary or closed-source projects should review compatibility before use.
Quickstart
from libjpeg import decode
import numpy as np
# Decode JPEG file to NumPy array
arr = decode('filename.jpg')
# Or with file object
with open('filename.jpg', 'rb') as f:
arr = decode(f.read())
Requires Python 3.10 or later; NumPy must be installed. On Windows, development builds require Microsoft C++ Build Tools.
Verify before relying
- Performance characteristics (decode speed, memory usage) relative to other JPEG decoders
- Completeness of JPEG-LS support and any known limitations
- Stability and bug-fix frequency beyond the stated active maintenance status
Package facts
| License | GPL V3.0 (copyleft) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 160 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 251,404/month — #8,584 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pylibjpeg_libjpeg-2.4.0-cp310-cp310-macosx_10_9_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp310-cp310-macosx_11_0_arm64.whl; pylibjpeg_libjpeg-2.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pylibjpeg_libjpeg-2.4.0-cp310-cp310-win32.whl; pylibjpeg_libjpeg-2.4.0-cp310-cp310-win_amd64.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-macosx_11_0_arm64.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-win32.whl; pylibjpeg_libjpeg-2.4.0-cp311-cp311-win_amd64.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-macosx_11_0_arm64.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-win32.whl; pylibjpeg_libjpeg-2.4.0-cp312-cp312-win_amd64.whl; pylibjpeg_libjpeg-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl; pylibjpeg_libjpeg-2.4.0-cp313-cp313-macosx_11_0_arm64.whl
Keywords: dicom, pydicom, python, jpg, jpeg, jpg-ls, jpeg-ls, libjpeg, pylibjpeg
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pylibjpegDecodes and encodes JPEG, JPEG-LS, JPEG 2000,…
permissive · top 15,000 on PyPI
pylibjpeg-openjpegDecodes and encodes JPEG 2000 images to and…
permissive · top 15,000 on PyPI
pyjpeglsEncodes and decodes image data using the…
permissive · top 15,000 on PyPI
PyTurboJPEGPyTurboJPEG wraps libjpeg-turbo to decode and…
permissive · top 15,000 on PyPI
simplejpegEncodes and decodes JPEG images directly to and…
permissive · top 15,000 on PyPI
turbojpegPython bindings for libjpeg-turbo that provide…
unclear · top 15,000 on PyPI
python-gdcmPython wrapper for GDCM (Grassroots DICOM), a…
permissive · top 15,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
lilcomLossily compresses floating-point NumPy arrays…
permissive · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI