A Python wrapper for libjpeg, with a focus on use as a plugin for for pylibjpeg
Project description
pylibjpeg-libjpeg
A Python 3.7+ wrapper for Thomas Richter's libjpeg, with a focus on use as a plugin for pylibjpeg.
Linux, MacOS 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
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())
# Or simply...
arr = decode('filename.jpg')
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.3.1.tar.gz
(671.5 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bd2330c90aaf630eabd698ad7fb27ff0cb7ba22e1b83ac4378b9c6a76180aaf |
|
MD5 | edd4ee9e58d0e61d15cf273319f60d6d |
|
BLAKE2b-256 | ab15aa93680a38fa8182bed3730c9b0469e527d763b17e11df6c1c85316d86b0 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 922898494285daa273b5b024dd636a9ea6c054ad44a6a6d45e658349838fee58 |
|
MD5 | d4d92e5400ec683c79dd4302fb5def4c |
|
BLAKE2b-256 | dc2116ab4e13715180364cadd28ba49786c5cdeffc28546afc844b08115d81cc |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078ccc05a0600d762ee8bf0b98ea4900bab938bbd347be550f333766915dc8ad |
|
MD5 | 554dffa958d3fd817544be1c3aeea446 |
|
BLAKE2b-256 | 3c768fce6e93a1bdbd10aa8246b5cf45439b62a9d210c3eaef3b65a862b69f4d |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a83c82a78e69735f723334b1e094a04d2b498e218e0d362cbcf37a63e5353c79 |
|
MD5 | c0a8d40b3e0893e60e7de5035de26146 |
|
BLAKE2b-256 | 25937ea995565a04cafe8e33ccef75e6881307ec8284412cae387489c1d33fe2 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3511933b9372c29caac7214ba5f0cd3c67b86fd027e7ea8dc667ab92538398e2 |
|
MD5 | 9ecfd8f29ce02c5b1032ae61ec66b507 |
|
BLAKE2b-256 | 6f5ffc326c15d4c146e3da9bba9106660b70a2b52ab384dde0176290be672d82 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab43a4fb6048b0712f34367ae552eb9f362ca5fc9d867c029e05c25920dadfe |
|
MD5 | ce126bfb928303d831bc1f8ace3ac57a |
|
BLAKE2b-256 | 2c22a801571c3910b63e0a5d6f31e632dbff79b327070b9effc768c9f8386290 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e678c8ed8e1575736cec5db57f29ebed575712bcb6416efc3bda03fde63dc45 |
|
MD5 | aeffd7bbd715ce93d5eeb6db32c15eda |
|
BLAKE2b-256 | 2c19d71e44f1ba7b5c3bf4a777095539a33a5082762c4491b16f8808ddbb8ff9 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c59c96402f6019e746781a8d893f1109a43fddc0be838270c80d092e6dba529 |
|
MD5 | e87bd5407d000f3d8eadd76aceb4f239 |
|
BLAKE2b-256 | c5a6abaff5c2b5f209d388d17da7452c9bd354f732f5e70fe91b54be60527e37 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b87bb6ae87dfe3c15971fa88c00d20076952a1474e2c4228822c299e2e034e4 |
|
MD5 | 4de01703002fa34382fc5f4f92f79e76 |
|
BLAKE2b-256 | da7d976934bc8804f9cef1580acf853a52da3f9c2eb265712a1ff2cd19202f80 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10fae11be19188e0a66ff60561afe3a1ea201c09ba837783986f896a5d08c5af |
|
MD5 | 5ed47e71c3540d0ebc8058a7d227abf8 |
|
BLAKE2b-256 | c754da90042c7e4554328c8b4dc3491f7c591398a10d604b3e5f03c65979dc21 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df66a64f171015d2dee6a1ba1422883ee6e512900985cebd3d24d0fc825bc7da |
|
MD5 | 1258927c89bed4ad38e7e1e51430e88c |
|
BLAKE2b-256 | 3f67eba8e69e50afd236236ce8ba6a3b2190f831fbdfc1d460d7268842f30aa0 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e27826e4c86f03598f9d42e7e213cae4c5550d1d8575b34957c012fe0337e5d9 |
|
MD5 | ecee86bb448bf3cf1e582f336aa44550 |
|
BLAKE2b-256 | e6b8db0324b922856df1b6c664f6ae6e38f7e7289a939fd60ab2568c7365b33c |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e08fdea455ea799630c3eee0cbad3e80a013a406296e519bfd94efaea34890de |
|
MD5 | a615985a7e22619e0fb4f811bcfc54d2 |
|
BLAKE2b-256 | c127bfaa35c2933ecc08c5a685229b27306ff2eeab72349004bda85a65a3ebad |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7075d75c17835f6d1db3232afd60d70a10b62ec5c2a86cfbac9ddef9af46a3cb |
|
MD5 | 0f85a2dff739bba93c1cbc9191a4c79d |
|
BLAKE2b-256 | 5377f9365c782921e30e89d5bba5b1de507e55450ea10dbbd3823b9b942b35cb |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62204414b6e22ff91c4411035988945222542cb188b2f297b5aec8d3ca5408b1 |
|
MD5 | 6f4d596cdb1e614af5503ebfccf9aec8 |
|
BLAKE2b-256 | e02065463b879b14d88dfcbff4b8f40a228033e4a09b8eb9894848bef1681443 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a9158ea0c16be7634aa22e3f46ddacceb9fc0f3cdf28a2b655d58f0578808d0 |
|
MD5 | f2e0cee56d83ba91adf60a49cd7abf8b |
|
BLAKE2b-256 | af6a40c477dd7b1ad48b2d970a5d5d44030392d6467adc66af97b450fce45d97 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 829a4061635702dd744dd9b3a0605329f014682e063fc51c5bd3b6a03ca8e016 |
|
MD5 | 3eb8887f894822d8f8a2b35e2a9145d5 |
|
BLAKE2b-256 | 4fed6a4994f7ebeee0c73455c72a30d883daac75cb281ef049ce6cb8a4aba2fa |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3641c71e949e87ed9b433b0fae2430caf3680ec18521366c8b0c45e9581907c |
|
MD5 | 195150b61228b71a1b3c5c2f0e129e86 |
|
BLAKE2b-256 | 0e01f4f00f10283350929f2d2a7c0a761a7946f08733e4a52984f17f1778a3d2 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bffd061dd78449a46dd3afd09c5ff1a272e0fcbe6ab795ee1991c078fc2cc3e5 |
|
MD5 | 9e7cbbc3359adee9ac05e9b7e325b32d |
|
BLAKE2b-256 | 7e1ee58c1c11e9428f29a671b6ed2c0d463ed9fb44da759a1543d679d05cd05d |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a2f57771dd5db5873df93db407ea28b3704c45bf89b4f8d0ede6a2624c1ff9 |
|
MD5 | bf5ca64638824af15f1c82e99aa96c2d |
|
BLAKE2b-256 | 0dd84dc9a94c821319b2b89490806ae9f2b532c0e3e1fcbbf93fcf829b335c4e |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec65cc3272f9642205666838b489950c600d1b0d6dcf1e20d583b72f696b7163 |
|
MD5 | 3e2b7ec1db02d951e95c87d6e22ec47f |
|
BLAKE2b-256 | 32d7c8ed4d1edd9ec1a42e7446806d0aa0baeed3e22e05c96195ff5930ed3173 |
Close
Hashes for pylibjpeg_libjpeg-1.3.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f2cbf41778d443bbb185d725ec1607a9f5a9740cbfe8e99334397b0563a2f02 |
|
MD5 | 2971d738b224aa985af7b489a1f2a89e |
|
BLAKE2b-256 | 17cb30a04c790fdf20698bbb86cfbf0288777dc1e7ad953dd81d9f061de188e0 |