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.0.tar.gz
(671.4 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ece82249e9bb68a9501dd0034cc095f7c6938a245b26f94b79246f63dc842229 |
|
MD5 | dbfea665224bf4dce78c209d1449bbe1 |
|
BLAKE2b-256 | fd75adc97fe0ea1292d97acbb2ff157895eb3358ee5c966fe2ea5615f483caf1 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4a1f61a80b0bc17d5ca014ba41d1807f0e1d712e14733387ce50c9d61fc8e9d |
|
MD5 | 29979c4386e2a81a4316e011a267606b |
|
BLAKE2b-256 | a02d09e11c74668685af6ed4f8e38c59b5f87c64c0cab6763f69b41470f48f86 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc2cd16861a05a55d8f05bc5a03f2b7fb81e3b77b1c77f25e42ae9daef8d9177 |
|
MD5 | 8b89d421baa901f6ebfb787fe3c69943 |
|
BLAKE2b-256 | c9776f43cd5c1549eb47aea5a901a36850853151ac71f2ca280d7c167f9ca8b7 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a112218b989bfc570ca828d256b7fc1277ec56c0958471a94f513fd49dc425e9 |
|
MD5 | 9220c125ee1e0f1ebd2dd5b7a6fc2e0d |
|
BLAKE2b-256 | 33084743226c8ceb7c9f436555f4ccd0306bc9759de3b6482e3ed31231dd4e00 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0288b88fea0488b1549effa57c065704cd13b4b43f50c308b62bc676b0578ea5 |
|
MD5 | 1845787d6efaa7c48058e0b3bbe81533 |
|
BLAKE2b-256 | eae240cb99f878cf6ac399f842500cb1a1843e39fb61bcf7f798c7e827da207f |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3244ca86df3eaa06fe6bf4753c4f2b45679bdee229c3f7f269e3830500e19d50 |
|
MD5 | f919a55dc3bdc7423f273fda5f36735f |
|
BLAKE2b-256 | d930daeb7cf1cde96daad1faad4ac3a884da851382c2f70f50b68e89689681df |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa641328d9d2550ef7ebde88cb0e751bcbce7022b2b9f38af81b1fe9f5bf62d2 |
|
MD5 | bea91dda7865ac9c46979cb23677e58e |
|
BLAKE2b-256 | bc633b620b23bdff7eb163898f2e0331e8d53fb1ae15ed08f77fcb2ce6250c2e |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cdc2ef03c8d96d1faaaff92c22f82aee90453c1ec6bb669aabecb50320ebece |
|
MD5 | 99ef10a6ad9fc420f1ad4c9c98820a9b |
|
BLAKE2b-256 | 12a7c2a360595748b585876e3964945e34fd216709544ffbe59a3815a18466b3 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e049363e0a84b1f2d93541f000fd9530d82d420f3c720fdb70a822a36854c257 |
|
MD5 | ae4934ce5b48bd50ceee33e09d02769a |
|
BLAKE2b-256 | 9343d2612097dd34be5867f50fa0cda46c8e73305773ac9681ac17823ef9dd75 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4b31eefd420831f8e6143eeda5add6f939d2102c5ef59051248e89adfa37cb |
|
MD5 | 7dd1b599f29e1eb1099d3d6cc0df195f |
|
BLAKE2b-256 | 2242e02f93c81e825a1cd112b68563d7c1b381019d7b2915002519fb41b4ea98 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15dbab81e7139b9f145c1ce77ae0345c915473907bb01fc4cb6ae5f9c4fdfef7 |
|
MD5 | 1d778378160d2556faa9c3139100c8b7 |
|
BLAKE2b-256 | acd30bb59707cf72ae0669dcadc16029a6ea51f1f17e7eada93b49fe4bf9e13b |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cef0778130e6c8ce07521ca36f12f1a2ac4bf276d469b23378dc9f25a106aa3e |
|
MD5 | 2e83b68e8b6233c8a0a229fb7ed105c3 |
|
BLAKE2b-256 | 6ebe0f11a648a8285bec3d74307bc7e2d2589301f155f36cd429450ac91f1313 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae322fd052aeca8af43c1a8173fb444e237703b4d86cbf9be6bfbd9a58f604f |
|
MD5 | 3c4fb8fe6b77bee23bdbce47e62d874f |
|
BLAKE2b-256 | 0a98002afc48b2c61fca6f886fb0e7af887607d02afce670cb41c31c7ba5d4bf |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f1045dc415e672d5fafe7609b69157d696618d5fcea3d7daa34a09397563e85 |
|
MD5 | 4fc403b80d03ee855a3490a1256a2300 |
|
BLAKE2b-256 | b3b9582f788961650b29b301df5c05562ff68fc151f2dbcee5518a09484cecc6 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8efe4e48128f86b91bc08573458d37efaacba3d32206ebe79b3bd92d37be73a3 |
|
MD5 | d8abc6d37229c753dfd796385469c1ff |
|
BLAKE2b-256 | 14462f672fefcfa76ed43ae4c4e9b04429cb7ec5a395c2e7177fe932a750f472 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 804c01ef4c43094d97cd01e7cb8ade8a37135e92175190e125de58acb4f5f2ec |
|
MD5 | 2ba58e1024146456349827caa9824531 |
|
BLAKE2b-256 | 747d5090f3fe599191d4ca21be5eac549a66e28a7f37781a446b5931a5a7d74e |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c54c5283ad21a752a3f60f46878f4df58219ebd0b380bf61305db4c11a785bc |
|
MD5 | acc1a18b981a364fbc37566ab1e42d52 |
|
BLAKE2b-256 | 5f342e0b36a4e73e7cf012d0e895a8cbcedb609ac6310fab78782469c86930dd |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d6f51e184ae6337815616262d627f0b7093fa930ffd6941fb8839a0428acf5b |
|
MD5 | 8d058849b0ce0edff65209d51b1a0b6e |
|
BLAKE2b-256 | d0035925f0a859469466a940ad9f541503c1ece68036bdfd798d85a85dfa8314 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ac787fcb09e48b71391d00db0bd4c861fe4f1377bfafea08f5a8f7d24cefb5a |
|
MD5 | 186d240f5b475cf27e6348c5b2cdbc4b |
|
BLAKE2b-256 | 59e3bc522b76da19efa62f9dc80dea6b6ddc02a8b06174f47b08434ce40ce498 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 225eb2e4e6db00e8caaa4cafc0e9781eaf01c6de2bb4186282858ac9a49a6dd0 |
|
MD5 | 2cb220de2ecfe41e488a8067c8f40553 |
|
BLAKE2b-256 | 8307bec2ff13fa00d779be1eb4983ad04211120698c1cebd210cccc667f23c78 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee362222ec18dc522795b28cfeb0cf95ea1f78850aa84e875aa7b5ee945a2824 |
|
MD5 | 2a5ecac252bf4946d1203c5c34026236 |
|
BLAKE2b-256 | c26c430e45eb840c0399825f99891612997735fd3f432b7ca23e2e71dd292297 |
Close
Hashes for pylibjpeg_libjpeg-1.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12da16ee77b2df56fe09f436491648b2ea481e6c6949196f24b32e209908cbb6 |
|
MD5 | ceaa5fc144957e089eb3eea2ed7f3a23 |
|
BLAKE2b-256 | ce0dfbaf522d6a36be37467c8d0bb60b84401c68b857a691ff90308c5179fee4 |