Skip to main content

A Python wrapper for openjpeg, with a focus on use as a plugin for for pylibjpeg

Project description

Build Status codecov PyPI version Python versions

pylibjpeg-openjpeg

A Python 3.6+ wrapper for openjpeg, with a focus on use as a plugin for pylibjpeg.

Linux, OSX and Windows are all supported.

Installation

Dependencies

NumPy

Installing the current release

python -m pip install -U pylibjpeg-openjpeg

Installing the development version

Make sure Python, Git and CMake are installed. For Windows, you also need to install Microsoft's C++ Build Tools.

git clone --recurse-submodules https://github.com/scaramallion/pylibjpeg-openjpeg
python -m pip install pylibjpeg-openjpeg

Supported JPEG Formats

Decoding

ISO/IEC Standard ITU Equivalent JPEG Format
15444-1 T.800 JPEG 2000

Encoding

Encoding of JPEG 2000 images is not currently supported

Transfer Syntaxes

UID Description
1.2.840.10008.1.2.4.90 JPEG 2000 Image Compression (Lossless Only)
1.2.840.10008.1.2.4.91 JPEG 2000 Image Compression

Usage

With pylibjpeg and pydicom

from pydicom import dcmread
from pydicom.data import get_testdata_file

import pylibjpeg

ds = dcmread(get_testdata_file('JPEG2000.dcm'))
arr = ds.pixel_array

Standalone JPEG decoding

You can also decode JPEG 2000 images to a numpy ndarray:

from openjpeg import decode

with open('filename.j2k', 'rb') as f:
    # Returns a numpy array
    arr = decode(f)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pylibjpeg_openjpeg-1.0.1-cp38-cp38-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pylibjpeg_openjpeg-1.0.1-cp38-cp38-win32.whl (3.0 MB view hashes)

Uploaded CPython 3.8 Windows x86

pylibjpeg_openjpeg-1.0.1-cp38-cp38-manylinux2010_x86_64.whl (3.6 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

pylibjpeg_openjpeg-1.0.1-cp38-cp38-manylinux2010_i686.whl (3.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

pylibjpeg_openjpeg-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pylibjpeg_openjpeg-1.0.1-cp37-cp37m-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pylibjpeg_openjpeg-1.0.1-cp37-cp37m-win32.whl (3.0 MB view hashes)

Uploaded CPython 3.7m Windows x86

pylibjpeg_openjpeg-1.0.1-cp37-cp37m-manylinux2010_x86_64.whl (3.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

pylibjpeg_openjpeg-1.0.1-cp37-cp37m-manylinux2010_i686.whl (3.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

pylibjpeg_openjpeg-1.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pylibjpeg_openjpeg-1.0.1-cp36-cp36m-win_amd64.whl (3.0 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

pylibjpeg_openjpeg-1.0.1-cp36-cp36m-win32.whl (3.0 MB view hashes)

Uploaded CPython 3.6m Windows x86

pylibjpeg_openjpeg-1.0.1-cp36-cp36m-manylinux2010_x86_64.whl (3.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

pylibjpeg_openjpeg-1.0.1-cp36-cp36m-manylinux2010_i686.whl (3.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

pylibjpeg_openjpeg-1.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page