Registry / serialization / turbojpeg

turbojpeg

JSON →
library0.0.2pypypi✓ verified 84d ago

Python bindings for libjpeg-turbo using pybind11, providing fast JPEG compression and decompression with access to lossless crop/scale operations. Current version 0.0.2.post1, requires Python >=3.7. Development is slow with only a few releases.

pip install turbojpeg
INSTALL
IMPORT
SIG · TURBOJPEG
T
turbojpeg
serializationpythonv0.0.2
Install
1.7s avg
Import
—
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 20MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TurboJPEG
✓ import turbojpeg
✗ from turbojpeg import TurboJPEG

Basic JPEG decode and encode using TurboJPEG.

from turbojpeg import TurboJPEG import os # Initialize TurboJPEG jpeg = TurboJPEG() # Read JPEG file and decompress input_file = 'input.jpg' with open(input_file, 'rb') as f: jpeg_data = f.read() img = jpeg.decode(jpeg_data) # img is a numpy array (height, width, channels) # Compress back to JPEG output_file = 'output.jpg' with open(output_file, 'wb') as f: f.write(jpeg.encode(img))
Debug
Known issues
gotchaThe package version 0.0.2.post1 is very early and may have API changes without notice. Not recommended for production.
fix
Pin version or monitor for updates.
affects: <1.0
gotchaPlatform compatibility: binary wheels are not provided for all platforms (e.g., aarch64, manylinux2014). You may need to install libjpeg-turbo system-wide or build from source.
fix
Install libjpeg-turbo via system package manager (e.g., apt install libjpeg-turbo8-dev) or use Docker.
affects: all
deprecatedThe 'decode' method returns a numpy array with HWC format (height, width, channels). Some users expect CHW.
fix
Ensure numpy and array handling match expected layout.
affects: all
Upgrade
Version history
0.0.2latest on PyPI · released Aug 6, 2023
Audit
Dependencies
libjpeg-turbooptionalDynamic library required for binary wheels not provided on all platforms
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
turbojpeg — pip install turbojpeg · libregistry