A Python wrapper for libjpeg, with a focus on use as a plugin for for pylibjpeg
Project description
pylibjpeg-libjpeg
A Python 3.6+ wrapper for Thomas Richter's libjpeg, with a focus on use as a plugin for pylibjpeg.
Linux, OSX and Windows are all supported.
Installation
Dependencies
Installing the current release
pip install pylibjpeg-libjpeg
Installing the development version
Make sure Python and Git are installed. For Windows, you also need to install Microsoft's C++ Build Tools.
git clone --recurse-submodules https://github.com/pydicom/pylibjpeg-libjpeg
python -m pip install pylibjpeg-libjpeg
Supported JPEG Formats
Decoding
ISO/IEC Standard | ITU Equivalent | JPEG Format |
---|---|---|
10918 | T.81 | JPEG |
14495 | T.87 | JPEG-LS |
18477 | JPEG XT |
Encoding
Encoding of JPEG images is not currently supported
Supported Transfer Syntaxes
Decoding
UID | Description |
---|---|
1.2.840.10008.1.2.4.50 | JPEG Baseline (Process 1) |
1.2.840.10008.1.2.4.51 | JPEG Extended (Process 2 and 4) |
1.2.840.10008.1.2.4.57 | JPEG Lossless, Non-Hierarchical (Process 14) |
1.2.840.10008.1.2.4.70 | JPEG Lossless, Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1]) |
1.2.840.10008.1.2.4.80 | JPEG-LS Lossless |
1.2.840.10008.1.2.4.81 | JPEG-LS Lossy (Near-Lossless) 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('JPEG-LL.dcm'))
arr = ds.pixel_array
Standalone JPEG decoding
You can also decode JPEG images to a numpy ndarray:
from libjpeg import decode
with open('filename.jpg', 'rb') as f:
# Returns a numpy array
arr = decode(f.read())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylibjpeg-libjpeg-1.0.0.tar.gz
(592.3 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1d396f832d3a835851e3ccd2f409ef732e5516b32c7908ba06b46ef981d934b |
|
MD5 | 636e56e7c955a10bade37eb8de70868a |
|
BLAKE2b-256 | 86e8983524be84bfaffcaebe9f6812eb5fb2428e9637bef324c8458173631bea |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 928bc3080e87b4b99170dd2a189a593c6f13c76341932cece4940758ac90b884 |
|
MD5 | 4136f52d14658dfc9a63e47f589211fd |
|
BLAKE2b-256 | 3c0b60bfa3051f6ab51cadf74c71e7ee0ffd5b631e12a7085a768ac2b5c007ef |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d60f304c8b65baa689bf06469379f18f465c48092beb5f475bdaab261f8af809 |
|
MD5 | 9caa8a5dae39082c311b3e80b252f905 |
|
BLAKE2b-256 | 61ec216436e508d69b8472cb794ce4f33e209b16f001855bb1c1b937ed8d8a95 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b3b468553dfcacc1305d43a2c4cefc3a4c00ae0e8c08b47400edd7fb5aa9f3 |
|
MD5 | 6372d4db28690cd273811e148b81f4f8 |
|
BLAKE2b-256 | 379bce99458a67a6779db9a7c516e4464090d39428eb75d3844dc670bc901a14 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d1cde689b2077d17e96250949fb45e62fc40f0bc510a52563e820b4176fb88 |
|
MD5 | 35694b0f6c23f086a5f15023031be048 |
|
BLAKE2b-256 | 62905a4016ec13cca8185b8263a6e22acc34ccfe48b90767dde32f72322efae9 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a83cdf26c811e4840b533ec8a23d86553e6b1194a2418d646348983b4c5a0783 |
|
MD5 | fed3eab579d714fb52e80a0924ec5f56 |
|
BLAKE2b-256 | 506a522eebad768b82621861c3003909611783f0c21431ee2bcb8d092bc5a562 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca40d98d3d2cea7d259fba20fc4b6664ea6ceffee6b801382355962848e7966 |
|
MD5 | 17c18a07af7b10570016423341ffbf18 |
|
BLAKE2b-256 | 30dc67ce9fec6f0cc3074f24f1e7169d9636358d5ae73ab457960ceb51e9afbf |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86fc6a130fc03c8b5b8cb2e907f23323adf6e8c8480775540ecd898305fefe23 |
|
MD5 | a8b5d415626fbfcc5a15ee5b06ecd658 |
|
BLAKE2b-256 | 1ae56122af7d520fc1f451d554a5a86b584b1961739a08e300f9e6155bfcfb7c |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a6e9fef41f8b07eee97cb66a43215ad804e2dd93b64bfe094739fde60311bb |
|
MD5 | d0717fcbe48a876956a242729bbd531f |
|
BLAKE2b-256 | 406c44384bd57f211fa20160b7f34b2b936943cd77de7196625ff6adbd098d38 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2562c6a5bf0678352f5bf58f7f4f636fb8f14ceea53f70fb509c01f5f6c10141 |
|
MD5 | c373506a8840344ec3abf26e2fd4a745 |
|
BLAKE2b-256 | a3618dfc10f5e8b9bd9bbfeb239b7580fa3eca38297038cda4fc01e0278bd9eb |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6bb24c0388ac4c9f7eb5b4474827bfd725b1069bf83df75c1fc60e66325c4f8 |
|
MD5 | 6d2e7b7f53338a4f7dfd56ecff2aa379 |
|
BLAKE2b-256 | 4fb75a9b56f301f4151fb19b7e43b9991742e6b9ecdac6253d1f500636a51d23 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7b6cbfcc2a6cd6f097d727517b44fe43729afc9e4a02fd0d6c8a003a98e74c8 |
|
MD5 | 0807bbf638e7ad020454b9bd03a3021b |
|
BLAKE2b-256 | 463825957b1fc302093571698fe48bf5215b7eb845ab44e66177d6332e5d41e0 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dfce465c7e68821115a03b20db9043e01792abb779ef4304f735f3c5fa8ede6 |
|
MD5 | 586d50b545c723d4e862f1730e7df4c7 |
|
BLAKE2b-256 | d9766bc0da1cfea5b5f75996e904ff7bbb2409b27e354ee081ed110f5c0f4fe6 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b128c80b57f670d1a91927901233e2084135a7af2130a767498edfbc6ad0e13b |
|
MD5 | 1380e5524415c692bd7b303f1fe8af2b |
|
BLAKE2b-256 | 94538de8e6a68c7599b2c988f17c26d17b03b0d1d9fde667ef1224183181ead7 |
Close
Hashes for pylibjpeg_libjpeg-1.0.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a75540a09aebb8aded70fd59a10b75fa77c5473ff93b987e412f52ada65316a3 |
|
MD5 | 30ac0c29e7071b1ecd7d7be21642ec99 |
|
BLAKE2b-256 | 8e393a8bea262a80a2b81cfaf82c21ec3aff3f297b13a329ca233c9d40b32389 |