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.2.tar.gz
(682.8 kB
view hashes)
Built Distributions
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cb179bb3a54d5466a85ee15c3f80364952571cadd96871b81318de7d9f498ea |
|
MD5 | 23506035c6696eb8ade8c5b61f76d6fc |
|
BLAKE2b-256 | 5efc4445fd57873a141bf0dfc7229874819c9be37721280e99d7a3fccd7055a1 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52bb26becc9c9d171c0950c425cb83d1f4b5bb8fe4d151691d415c8621e93483 |
|
MD5 | 3f9a759d8c45d78d9e635681cc38322b |
|
BLAKE2b-256 | 04dcadef9301923d47735af9fc5f501124c80cbd38e3f1e032620f8c7de88098 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7974ea3676be7d5eb197deb83f0496313c3b5e1b4b57f82749694163fa74be1 |
|
MD5 | 6fa4b4a562d2891a0a81cd83238373e3 |
|
BLAKE2b-256 | bab74f3f07ddba1405de5589c1279c08f6ee96f1ab70a95795ebbce60faebdaf |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d05ca61d4431bc9ff095e709846046f4116f9c3f1cb5ca8b1775e27bf9e5bd3 |
|
MD5 | 9e4b50bfa4901291403a8384b0235229 |
|
BLAKE2b-256 | d108daf0d0a4b972fc323fe0ae7bc9b705c4c187337e3370a425dc70314ccd2f |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0de4d4f229327d1e098d47152f8e9371687e0692442c974a2c9668b9a612cdbd |
|
MD5 | 544f418648b2edfd72ad59cdcb16a007 |
|
BLAKE2b-256 | d245545ee80b83654e14b95d5f3c7e9d8bc44c815d5d79060b4cecd5e0aa026e |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f9d036c646fb6e8a6277ea51ee186038e05b9ba45fe066bcc09693d28bae85a |
|
MD5 | f7f64fd361ac393c34dd475bef55a47d |
|
BLAKE2b-256 | 2bb687caf7fbd985287ea64da8629988d68b6fa03c684892cf24c9ef51ace90d |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5173be530568627307c62a9d908395afd1d04fcd1b1921187835c6dcd5d826c |
|
MD5 | d08d7955e92bf6cba3c29b19729d6ea5 |
|
BLAKE2b-256 | bb7c94340d8a49043dff25ffc9343986bc0920ba96997cc5f7a7c3cd6f2b99ef |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96b71301d111d8874d2b43f67c8bb83b794ec398ebb67210d92bcc83dee56912 |
|
MD5 | 7417170e34fae0968f39cf725577a301 |
|
BLAKE2b-256 | b9df18b6ba94a17a1cb95d58b672de522ea97e0211d7006e57c0322a490ff306 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc79fd5afebce8f6c6df5290b90ca25315f1ba383d6543f3a914c31954811663 |
|
MD5 | 9c43f615499422521f0b4d7df70a1ae9 |
|
BLAKE2b-256 | 7bf66ab1f7d51b01afccd1f064f9f799ebce94f71f0ef0f64f8041140b50cd67 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bba012129de62d1de8740cc26cb396c522a11e4a90cd75df7296ed78c9ebc2a8 |
|
MD5 | 77fa5ea75d9a49e1b983e06010cd6d6e |
|
BLAKE2b-256 | c3351348df32763e9d070ea6223defa9c4e55abdb1186c9d95e1ef21dd23ffe6 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2100235163aaf38e4c682abf8aa197f34ff48b96118dd829239be1325c3297dc |
|
MD5 | 25e5f0685a118789567404ebff449e3d |
|
BLAKE2b-256 | 5ea3c335c76de498d112ebc1b41689af1795332e9fb047b0dfb25f8ef37a4b31 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f27bd473e74bb306d5e15eed1c7689e3da9f0cf8455e33c3d4a2558a1230bc5 |
|
MD5 | 0b365f666b8ce2ef329c79357f869887 |
|
BLAKE2b-256 | e054d5432489c2c8088c2434d8af2d6e79a4241a882774c11fefa51bd4836566 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4ff51fd8bd0144c0f266589f651ea640e17d190f9fd9878abc6c7b7774bbfd1 |
|
MD5 | d50faeef8811439e14ca7fb7b06d28ea |
|
BLAKE2b-256 | 912e1dced3932e01e21889492849cabaa5e2c32ef026601be89eedbc7cde1d6c |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d831fbfc4648a0bd41c320cd0cade61ebb2105b9caa7fce72bd7fe72f7e00a18 |
|
MD5 | c81b5524e5a1f8c526f531da0345e29a |
|
BLAKE2b-256 | 4338b3796c5a21e362026cb3f0d16fdb54db834cae25b29e371c785d1fd954cc |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1cd93ac8375490e3f4ea97168df300a28fa95ad975aada6242e96c431a955d |
|
MD5 | c7ab2365a1232469dd9e26afad66f6ac |
|
BLAKE2b-256 | a8ebf6e8b853d2113096a3aa1e7a1e01a27e8010d4510106560693b0e0c270e0 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 898e06633d938b2d71bf0a703eed580bd89bc99c94ba0adf5b0d3bef799a17c1 |
|
MD5 | 7dbfe05142def46f71654e2490bfa790 |
|
BLAKE2b-256 | 33c606c14d92ad1f819a3f417637b2f29c92e115296cd76fe344bf34cb972fcd |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9609036db4bc3a7f06fb16223d433924ecb1fdc4e55f0fef7063e3c4d7349b6c |
|
MD5 | a6a9eabd1d9431585cc03366dc9bf8c3 |
|
BLAKE2b-256 | fcf2c14fbf5aa7876d6a80b5ea54aedb0d8ad99216d99d0974b951f18626f06c |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0794f934d7f3f645b72c3a98b2e137ac807dc9b693f6674e3513994d0bc558d3 |
|
MD5 | 7d8a2228bf250df840ccd58115a9571e |
|
BLAKE2b-256 | cea492f67c7fc4eabecaed90bc12f713fc6e0e4c0017232da5fb14a1939914b4 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d006108e051126f28d36f34ad610b7146c9f887347fb05a7d817bf432c9adf91 |
|
MD5 | 1a5404196deedb77cbf43f35624a238a |
|
BLAKE2b-256 | 1046ae91f8d5e974ab21dc827f77db47e62cd2e53230603cbe416f8161c3aaa8 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69222fe2882d6b732941b2e05fa1a03e11e7864fa95aeb8f40214026e045aa08 |
|
MD5 | a5185d6bc3654c576fe1f053ff7befc4 |
|
BLAKE2b-256 | c8ff3cb9823e5ba83a5a91081e1b3c282c659dabd4c4c17111d718195fe45c7e |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fadae1c5d4517c62a1258469c71449ce9d0e708d0d9c5b0b3e1112dda1db6de |
|
MD5 | 082e027ba9ae043c4e4cdc7715ba762c |
|
BLAKE2b-256 | 324e14b3287e9fce57fabfd1ab2ca3e79fa5e8ba59fea79f94008e7bf0f5a588 |
Close
Hashes for pylibjpeg_libjpeg-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0628278aa5e3b41e430ba921fa7634913e0e76430f8f1789b3041ea1db4e9967 |
|
MD5 | 9d0776427b87cbb585973251b53f2ae2 |
|
BLAKE2b-256 | 5e2b2e591baba36f92a5536cc72be87c460d04b680ba35596f9c566babfc1113 |