--- id: pylibjpeg version: "2.1.0" license: unclear license_treatment: permissive maintenance: active --- # pylibjpeg — A Python framework for decoding JPEG and decoding/encoding DICOM RLE data, with a focus on supporting pydicom License: permissive · Maintenance: active · Downloads: 275.7K/mo ## What it is and what it does pylibjpeg is a Python framework that provides decoding and encoding for JPEG, JPEG-LS, JPEG 2000, and RLE compressed image formats. It integrates with DICOM medical imaging workflows, allowing transparent decompression of pixel data when reading DICOM files that use these compression schemes. The package can also decode JPEG images directly to numpy arrays standalone. The package itself depends only on numpy and is lightweight. Its actual functionality requires installing one or more optional plugins: pylibjpeg-libjpeg (for JPEG variants, GPLv3), pylibjpeg-openjpeg (for JPEG 2000, MIT/BSD), or pylibjpeg-rle (for RLE, MIT). This modular design lets you install only the decoders and encoders you need. The framework is actively maintained, supports Python 3.10 through 3.14, and is classified as production-stable. Use it for: - Read DICOM medical images compressed with JPEG Baseline or JPEG Lossless and extract pixel data. - Decompress DICOM files using JPEG 2000 compression for downstream analysis. - Encode pixel data to RLE Lossless format and save as compressed DICOM files. - Standalone decoding of JPEG files to numpy arrays. - Handle DICOM datasets with multiple compression schemes by installing plugins as needed. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Decodes and encodes JPEG, JPEG-LS, JPEG 2000, and RLE image formats, primarily for use with DICOM medical imaging data. Yes, if you work with compressed DICOM medical images or need JPEG/JPEG 2000/RLE decoding. Low install friction, permissive license, active maintenance, and production-stable status make it solid. Install only if you also install at least one format-specific plugin; the base package alone cannot decode or encode. No known security vulnerabilities. ## Install pip install pylibjpeg uv add pylibjpeg poetry add pylibjpeg ## Installing pylibjpeg Before you install: Low friction install with a single runtime dependency (numpy). Active maintenance with recent commits and production-stable status. Requires optional plugin packages to actually decode or encode specific formats. License in practice: Permissive license treatment allows commercial and private use without restriction. Note that optional libjpeg plugin carries GPLv3, which has stronger copyleft requirements if used. Quickstart: pip install pylibjpeg from pylibjpeg import decode # Decode a JPEG file to numpy array arr = decode('filename.jpg') # Or bytes with open('filename.jpg', 'rb') as f: arr = decode(f.read()) Requires Python >=3.10. At least one format-specific plugin must be installed to decode or encode images. Verify before relying: - Performance characteristics for large medical imaging datasets. - Exact pydicom version compatibility beyond v2.1+ stated in description. - Whether all DICOM Transfer Syntax UIDs listed are fully supported or have limitations. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 275.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags DICOM image decompression, JPEG decoding medical imaging, JPEG 2000 encoder decoder, RLE lossless compression, medical image format conversion, DICOM transfer syntax support, compressed medical imaging, medical-imaging, dicom, image-compression [View on SkillFed](https://skillfed.io/packages/pylibjpeg) · [View on PyPI](https://pypi.org/project/pylibjpeg/)