pyjpegls
JPEG-LS for Python via CharLS C++ Library
What it is and what it does
pyjpegls is a Python wrapper around the CharLS C++ library that implements the JPEG-LS lossless image compression standard (ISO-14495-1/ITU-T.87). It provides encode() and decode() functions to compress numpy arrays to byte buffers and decompress them back losslessly. The package was forked from the unmaintained CharPyLS project to maintain compatibility with modern Python versions and add fixes.
The typical workflow is to read image data into a numpy array, call encode() to compress it to a buffer, and call decode() to restore the original array bit-for-bit. JPEG-LS is designed for low-complexity lossless compression and is often used in medical imaging and scientific applications where data fidelity is critical. The package depends only on numpy at runtime; Cython and Pillow are build-time or test-time dependencies.
Use it for:
- Compress greyscale or RGB image data in memory for storage or transmission when lossless fidelity is required.
- Integrate JPEG-LS compression into medical imaging pipelines where the standard is widely used.
- Benchmark or compare JPEG-LS compression ratios and speed against other lossless formats in scientific research.
- Reduce memory footprint of large image datasets by compressing numpy arrays before serialization or caching.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes image data using the JPEG-LS lossless compression algorithm via the CharLS C++ library, producing compressed byte buffers that can be round-tripped with numpy arrays.
Yes, if you need lossless JPEG-LS compression in Python and are comfortable with a package in aging maintenance. The library is stable (Production/Stable classifier), has no known vulnerabilities, and pre-built wheels make installation straightforward on common platforms. However, verify that the fork remains compatible with your use case and that the 655-day release gap does not signal abandonment; check the repository's recent activity and open issues before committing to a production dependency.
Install
pyjpegls on PyPI
pip
pip install pyjpeglsuv
uv add pyjpeglspoetry
poetry add pyjpeglsInstalling pyjpegls
Before you install
Medium install friction due to compiled C++ extension; pre-built wheels are available for Python 3.9, 3.10, 3.11, 3.12, and 3.13 on Windows, macOS (x86_64 and ARM64), and Linux (x86_64 and aarch64), so installation is straightforward on supported platforms. Maintenance status is aging—last release was 655 days ago, though the repository is not archived and received a commit on 2025-12-07.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
import numpy
import pyjpegls
# Compress a numpy array to bytes
data = numpy.zeros((10, 10, 3), dtype=numpy.uint8)
compressed = pyjpegls.encode(data)
# Decompress back to numpy array
decompressed = pyjpegls.decode(compressed)
Requires numpy; C++ extension wheels are available for Python 3.9–3.13 on common platforms (Windows, macOS, Linux).
Verify before relying
- Whether the package is actively maintained or if the 655-day gap since last release indicates stalled development despite recent repo activity.
- Performance characteristics and compression ratio compared to PNG, JPEG 2000, or other lossless formats in typical use.
- Whether the fork from the original CharPyLS repository has addressed specific bugs or limitations beyond keeping it installable.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | aging — 655 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 119,065/month — #12,091 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyjpegls-1.5.1-cp310-cp310-macosx_10_9_x86_64.whl; pyjpegls-1.5.1-cp310-cp310-macosx_11_0_arm64.whl; pyjpegls-1.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyjpegls-1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyjpegls-1.5.1-cp310-cp310-win_amd64.whl; pyjpegls-1.5.1-cp311-cp311-macosx_10_9_x86_64.whl; pyjpegls-1.5.1-cp311-cp311-macosx_11_0_arm64.whl; pyjpegls-1.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyjpegls-1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyjpegls-1.5.1-cp311-cp311-win_amd64.whl; pyjpegls-1.5.1-cp312-cp312-macosx_10_13_x86_64.whl; pyjpegls-1.5.1-cp312-cp312-macosx_11_0_arm64.whl; pyjpegls-1.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyjpegls-1.5.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyjpegls-1.5.1-cp312-cp312-win_amd64.whl; pyjpegls-1.5.1-cp313-cp313-macosx_10_13_x86_64.whl; pyjpegls-1.5.1-cp313-cp313-macosx_11_0_arm64.whl; pyjpegls-1.5.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; pyjpegls-1.5.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; pyjpegls-1.5.1-cp313-cp313-win_amd64.whl
Keywords: python, jpeg
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
pillow-jxl-pluginRegisters JPEG-XL codec support with Pillow,…
unclear · top 15,000 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
pylibjpeg-libjpegDecodes JPEG and JPEG-LS images to NumPy…
copyleft · top 15,000 on PyPI
pyoxipngpyoxipng reduces PNG file sizes through…
permissive · top 15,000 on PyPI
turbojpegPython bindings for libjpeg-turbo that provide…
unclear · top 15,000 on PyPI
qoiA Python wrapper for the QOI (Quite OK Image)…
permissive · top 15,000 on PyPI
PyTurboJPEGPyTurboJPEG wraps libjpeg-turbo to decode and…
permissive · top 15,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
img2pdfConverts raster images to PDF without…
copyleft · top 5,000 on PyPI