A Python wrapper for libjpeg, with a focus on use as a plugin for for pylibjpeg
Project description
pylibjpeg-libjpeg
A Python 3.8+ 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-2.0.0.tar.gz
(667.1 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c77c35eafd3fe80a37d368bd5af731dcc245c8a6df20f8dad1339d5275a2e25 |
|
MD5 | b89958e1d9a068aa6f6db38773fcfde0 |
|
BLAKE2b-256 | bd38bc074652a5a087787c92fbbff6c79b07f08ac1807531f0eb0827d453a045 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eac336dbdc2c76c1f150beaa6298cc6a93c0e91538ec1c63efb8cf098215b2b4 |
|
MD5 | 3be3578d8006043421e058896d883a11 |
|
BLAKE2b-256 | fc48748c9f981c705a2a0aeb2118b961da9a0d28181c41ffca0c7caae5add03e |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41db9244344b0652ced8a9896264771eb1593e94fb56e21d527afa9910a7d1a8 |
|
MD5 | 1c7082eee5477caafedfea5886237648 |
|
BLAKE2b-256 | ff14bba4d63a06a3670fdaf04d5105c9be03c2fd1d895376ccbf40877636b8c4 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd838d02a14c2c8b2d9fd529cf236023c6fbb2727e62b8efb9e9d10e5b67524a |
|
MD5 | b0eb0eb50eb21d69797da4af7dccbf9e |
|
BLAKE2b-256 | 0f85da2cfc231d4cbddfa8db6bf5424f925ffc5452309897c5f9df6f36956cf8 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp312-cp312-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 187ac7c8c60fb10219513b1cbbd10db9a81e959054a7b3d08102f1277911d076 |
|
MD5 | 9c856f079d341a82aafe41398ba51511 |
|
BLAKE2b-256 | 2c262b097f3e369e000a702aa0bc0d587fc4387c444f26cb2723af94ffb6a2c9 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22b159d17cb855c04efbce5416d1ef6b483bb21a68c2d0604ac3247ba9030497 |
|
MD5 | ea26d72cd64b1a7d9f7b586eae8fadb8 |
|
BLAKE2b-256 | 77cc3d20bc7b5588e9b97ddbd172f39ad942851b7aeff50804c5b16fee632571 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee114e0cc4c9890bbf8f35fc09e7c7bc5f50606ba52432cb635b0940e5ce1be |
|
MD5 | 8effed7010f9d407ed70ed6da7337393 |
|
BLAKE2b-256 | ead6c751853f42da32e8abf81975e5c89c8d1ae79c34c038bddbc4bc3f087130 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 223fba7b7915a20a3739f391b73a442303f3617c07429b835187ff5c1a51594b |
|
MD5 | 445333985725baf6460c8aa604865383 |
|
BLAKE2b-256 | b022fb3d43e465126757467a7b05c13d94e381b19da4ea2c32e7f6ff8b043162 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4b86a1b2f6e246be02bfb2c0116f1ec3c1730aa834a6cec1b29fd20e45d71f |
|
MD5 | 67354df11702d69a44f5162c9e0b58ef |
|
BLAKE2b-256 | 08b7ff24a2ca616cf7fb97d63374fb4bf61eea42a151f9d16ebc6489698f8b4c |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp311-cp311-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755cdf05a13e1d96de06ae097ff180b2e1ad0479460c8a09592599784d64e45f |
|
MD5 | 5e6c72b2d3ee22b9eadb85350303282f |
|
BLAKE2b-256 | 0050219b127e963e4dacac396357b58cbbfda5a83a45626f559963503ef81e28 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 100b0648c75e25d1d6745b54750cab107451b076b055bff0fb2c749caa5318c7 |
|
MD5 | f097bdab2fed3a74c806991956ba4747 |
|
BLAKE2b-256 | 64c53256de580a6818e72ee31d2e983b685fc79240e0978ac44754a4f1956861 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8739303e0aaf6024fb284a1cc8311500d566278cb9b0a17130f243a05a2e9b18 |
|
MD5 | 75744d3515620c1ed62fddee881d6725 |
|
BLAKE2b-256 | 3d9354e0ad9316df3b1dcf9b6356d337512f81f9ff60c75f8bdb600fccee3d45 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224ee621fad0570cb54efbe778695eafc62cb5a9d60c265c4d18778e05053eb6 |
|
MD5 | c26daf8d6956adf0e512d81d2871c060 |
|
BLAKE2b-256 | d644885f8c1e068f7ed33de750e2f1b171231e1a620f788063e8ca526fc15ae9 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60925f3e928cd30b3713904eb28dab39abd9e902d57aaa37d7b1704aab326fc3 |
|
MD5 | 7382df8f4a75d8ea5f74fde76da0948c |
|
BLAKE2b-256 | 8c965e8247a846d4b13bbc8d6df16d3492245339a5f594cfaeab9b4720bc527e |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 544f112d78de2af61ce7bf50a023a6ac452ae9e6557294f3cc9e1d176e79f863 |
|
MD5 | 38b26ba050ff8a13a2add03165b21d93 |
|
BLAKE2b-256 | 7c812581111cab5794874ca769b3f1968c9f3f39f093f7714151dd8e77f0520e |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c25f6f722052aa5676f4cb21b19b99fe47334612640340d5ffb7b30bbc27f3 |
|
MD5 | 61ad7a0dae1f261dcbfa826ad7f5602c |
|
BLAKE2b-256 | 0bf5dbc3b3cf1edb634365b9634a29a96bc30ffef4f5e9997514e42e4e2b4358 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08b2ce155e8587f0c8c29033da68cf6dd06e81a9dc22ca6a5778b06bffb7e0f7 |
|
MD5 | 1a6307b662418ba11e11413901aeed51 |
|
BLAKE2b-256 | dc5f8a254fbd269d9ec8a6d1e69185ad6494681c338e24304c7b6f6aaee73590 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac18d8250b167a7facf4039bc4d680c7aabc58b170aeaa2c9cafc5bb3a0f5001 |
|
MD5 | c1db35f556b4dd2e8db66f67ac82c7c6 |
|
BLAKE2b-256 | 77aefb6f108dde8a8785686bcdd1a0c826d77859d074746dc6a3a82ff68085e3 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1baf86ee67358bc75b40c6aeebcd6a8561d13050b2e9260727ca4d1d617915 |
|
MD5 | 0c866e0e279987948b59ba61fa0a5b29 |
|
BLAKE2b-256 | 25225659871e5fe00eaddaa2a8aa4db0ee99d02ae52a668ffcc4b2dcfb3a4d68 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp39-cp39-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a653a412ae1cd7104491629d44257c64545a92c074812175363ec929dc614c39 |
|
MD5 | 746a640528caaabd9c4309efef601e51 |
|
BLAKE2b-256 | a303cda27f62ff8f70ab2afd89f0d6007e4539b11f037f4f29b86c0203c3bc01 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84d2d295686c6b24c44a1981407b675c6fb547c893c405e8e33b5ef65d646416 |
|
MD5 | 49c74526916e161f7c557c18554d3a97 |
|
BLAKE2b-256 | d0a0eaa51749f639bec7dc09335a0b1987d989bafd2d153c78e553bafb1ea525 |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a53d3b1723e1c9e5c3b701c657cf23259af6060af9ece416af23d16905b849 |
|
MD5 | 8824bb4ff06e1bebef71164cfbc80225 |
|
BLAKE2b-256 | 5faf4a0d5cbbcd56262d2a172c4f1cde3ae69b604d93247d48ae7ecc8d20daac |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9cd77da81c00b2e5b2c12ac749a4063ef87e48b41ea1d55f03ff2c82c829541 |
|
MD5 | 3e623ca4142680264bccda8a1f5a59a0 |
|
BLAKE2b-256 | f38989efba714fada6e8279f499cadc6bf3d9024479bda445cc382faa23c218d |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69c51f8d7f3197f8a00afc4869a589b4dcc1d3207693cb5070277f3ad88db580 |
|
MD5 | 1e7d4de12d6fb87901a5fc54226646dd |
|
BLAKE2b-256 | 3e81ac8e17c111bf65e9e0ee33da8a9946539b9b0b6053c41965b4ed5d86ff0e |
Close
Hashes for pylibjpeg_libjpeg-2.0.0-cp38-cp38-macosx_12_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40efd38a694a0536bec80580100cd95d35e1b19f943d5eb7118f9e39a7a039c4 |
|
MD5 | 1ae7e66aed400f0bf33fb5654a581939 |
|
BLAKE2b-256 | 55c99b777cef3c9501b5440f6c2af7014054307e728b1a7e9e633ddd95c96ef7 |