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
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.2.0.tar.gz
(583.8 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 282208df3ceb344174761a5d19c3bdea98385fac5a76e1a8bb624f165365c67f |
|
MD5 | d25bd7ac6e3cb108d8b8229b6985a518 |
|
BLAKE2b-256 | 584c93e6afeffb5eb8c3b715561a8a67619f05da4741ea68f6d14ebc895dc840 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e31655aa29e0ea715cecb1bf3b43b5db66bf8d8a12e0117f526193033f635289 |
|
MD5 | 48e50360a242bcf403b2105a8f6aa001 |
|
BLAKE2b-256 | 4ae1ca86104a82522f054c1c50184fc59092c884395540ff357bebf926f9d7f5 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c278ec57788b3751353e1c588da29d4ec52089e331265246297f4762961dd7ae |
|
MD5 | 915be0c38f970e247308bb7ca430864d |
|
BLAKE2b-256 | 114dde8e7db41722fbb637ae60c3aba200c06ff3be69a056f8a044bc4ca3096f |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 984be91d4e861c31ad9f0425495c74963e73d7aa1b933edc3a2aadab8a822a05 |
|
MD5 | 37a8773abba02e561e62f53c5a9e4689 |
|
BLAKE2b-256 | c5da77ea5a79d1e80b1124358aeac51e057f638e0e1a30419d049a9ca7a45ae9 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a188e72025929938a1efb02b2b2d068dc05abd9986209e2a537c04fb3bef9319 |
|
MD5 | 68cc8a0aef3af3c227129110caa9f4e1 |
|
BLAKE2b-256 | 4777b76b7d67da049645ea6f1afedd091293c6e5e0b87a4edb7d3995e63f9b7a |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae60ca5251d0f740176142182285f597f6c564014cac038c7457b015612bc2d8 |
|
MD5 | ebf5c67810679e1c592285ff5319d957 |
|
BLAKE2b-256 | e769472b605b500260b1f2c8f493925a213a24ffeea0d2e216d99ec1e48bcc56 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d66c78a9ca24576d3fcf755c4fecf651fae6daac8c46dc20e0dda2ae68519ecb |
|
MD5 | 9eef589b698d2b17429498cf7666cd40 |
|
BLAKE2b-256 | 9e9fd96820b335354b13ad14583ec60180e237aed2ae582e5560cfcbdf2c67ba |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f21e74903d6ead2fff9cc59b8e755e4ad1b88143e4d79ce4afdf7a60d04574 |
|
MD5 | c4cfe8eafa3efb0113c979aff5b8b157 |
|
BLAKE2b-256 | a74ef06e00d8d277c867e96f9ecbabdad7ffeac5759362f06b16c652e6a77125 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4067d751d0a69e406e61b3262fdbd9387f95d76c65fdc8db9fd63451fd2c0b10 |
|
MD5 | 7de169d6cd00ec25653c11ed077e49ee |
|
BLAKE2b-256 | 28aa5db54de1f71319fa9a41f8dcb9fafdde535e8a8bd20942faca1127d40cde |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87df58e71fd310217e753604a3059494411997eb22ecd608550d52f097ee8985 |
|
MD5 | 555b1c275c3f4f594fb3a3e73ce12845 |
|
BLAKE2b-256 | 71ed1961547baf3864bc0e2f94549bb6fb0e79e27e491f3c71b8346db58110e8 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e16532e1a33b6aa19f3c6842e9f27015f16172ab4773ced86dcb60406b22c54 |
|
MD5 | 9bac1c94caa44b63478603503e176fdc |
|
BLAKE2b-256 | b819c75816e6955e8a600b6e63ea06d167aeb7e120dc0f1f65d2fedd6acfb018 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c386ccabf1d416f059a7c6e41a44789d39b0ebe937b73a636108d078e7ba066 |
|
MD5 | 290e90d864da70cc8e9352aa41b5e50f |
|
BLAKE2b-256 | 30e8e4140e882a217a8ab4dc9f44ab30abfedf9027e82efd380353d7237bcebf |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345cd0468ba65a4cc609848a0e2d758d765c75c7b0249d34baa1f900e0f8c683 |
|
MD5 | 24bd69b2f78e05bee212a946cb15ad87 |
|
BLAKE2b-256 | 514e161e2d740e8682e491f272415a4cafc955265ec110238d6d59b486e63e8a |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e9a4ad8b7e2db448e426cac57c0f420bed270b2a73197f12a5dbae4c02ea94d |
|
MD5 | f6c460a555cd74e514cdaa0b08bb94dd |
|
BLAKE2b-256 | 5a96131ed0920df4ff5f6a1498c839c1dcd947d9ba7cece1a282945af67ad2be |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fefac98521569f55b449544d902359fc12948362c6333e4b87a31a7ab50026f7 |
|
MD5 | 10817aa4daac2716d0bd56b273a071d4 |
|
BLAKE2b-256 | 3c982f1fd30ea504272065875cea233e22f4a2f7e4fa3f7503138c4d357292f9 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da78b3880f3fe448b862d51c7f3f0415fe55ec1bce624b5b854fde69ef7d7573 |
|
MD5 | 09b1045dfe0427f141a932411fed27ca |
|
BLAKE2b-256 | 4c3f59da6f45afc8a42b0295b5a6f347d0095570ef1ff554a88abb0fac13bf6a |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed34aff30b87d9384d7840701d8ebde46825c4a60190d23e38150702624a654 |
|
MD5 | 7fb7a0e3e6fd43408f151825c7fbf0b3 |
|
BLAKE2b-256 | 42ecba60e5a1aeab24367b98243d7ea0d3336478ac97c74f67a84123f078caae |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09782aac63c05edf0c906189dfe32b91b8d00fc603e1ca5c734bc5ff55672677 |
|
MD5 | 29b55a3787dd34c02cd714d0f0db5992 |
|
BLAKE2b-256 | 8e9fb881b4436500e0f83e53a559ffd36b9b4123c255ed3bb12f7e2f904a0cef |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e4109f8ddf7544e2241cee03d984091e3f8311aedfb85e88cad8e3a4a564e8 |
|
MD5 | 757f8f3699f5eb1b12eb26f1128150bb |
|
BLAKE2b-256 | 6f91cfcc144f366ab03b1f1491c0f3b1a498d481d30805d7aa3eab718f72bf39 |
Close
Hashes for pylibjpeg_libjpeg-1.2.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01f427527a17ef75c0ddbe8c87b5d4c34d03d741b8310bf75c421bcddf8c1934 |
|
MD5 | f92922c772544649c538b1ae37672779 |
|
BLAKE2b-256 | 8f649d8b1f6534ef35904ba1e2d53ffce6884309ed2c26e46e94d1292dac504d |