A JPEG-LS plugin for the Pillow imaging library
Project description
JPEG-LS plugin for Python Pillow
A plugin for the Python Pillow imaging library for the JPEG-LS codec, based on the Charls JPEG-LS implemetation. Python bindings implemented using pybind11.
Available on the Python Package Index
Usage
pip install pillow-jpls
With Pillow
import pillow_jpls
from PIL import Image
from io import BytesIO
img = Image.open("image.jls")
img.save("image_copy.jls)
# Saving to a buffer
buffer = BytesIO()
img.save(buffer, "JPEG-LS")
Options
The encoder supports the following options. See the specification for details, and the tests for example usage.
near_lossless
:0
is lossless - the default.interleave
: one ofnone
,line
orsample
bits_per_component
: override the number of bits encoded per component, otherwise taken from the image formatmaxval
: override the maximum value of any component, otherwise taken frombits_per_component
t1
t2
t3
reset
spiff
: Use a SPIFF image header, generated by default. UseNone
to just use a standard JPEG header.
Build
The build is driven by Scikit Build Core. cibuildwheel is used to generate packages using Github Actions, and C++ dependencies are satisfied by conan using cmake-conan.
pip install build
python -m build
Build without conan
To use system dependencies instead of using conan:
python -m build -C cmake.args="--preset sysdeps"
pip install dist/*.whl
Note that wheels created this way are unlikely to be portable and are suitable only for local use. A Dockerfile is provided in the root of the repository to install the prerequisites, see also the CI job that builds a wheel using only system dependencies.
Tests
A suite of tests covering the applicable conformance tests from the specification is provided. You will need git-lfs to clone the data.
pip install -r requirements.txt
pytest -v test
Limitations
16 bit multichannel images are not supported, as these are not supported in Pillow. 16bit greyscale images are supported, however.
References
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 Distributions
Built Distributions
Hashes for pillow_jpls-0.1.dev1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3922dd4e6871bf655ac1300694d7973bb0d45c9fb61273c5571f367c473ef3ff |
|
MD5 | c78e5ad0c24dc3c91c7e38aeb1262cb5 |
|
BLAKE2b-256 | fafc64fdf90b0be977f8b2425097f4fd7723e2da0f1f42159d239469c6d99448 |
Hashes for pillow_jpls-0.1.dev1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77a1c314df6a5f8a9da87a4b15b3a52bc4edda1810e5ccc03f371fceb0f3bd30 |
|
MD5 | a6efb4237feabc3989c68ca675a5de90 |
|
BLAKE2b-256 | 85c98b3cd9205f2858599445cb9f9dfb09003cf3b722994ebd71a9ee1b5622cb |
Hashes for pillow_jpls-0.1.dev1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30a6a6fee719823ccd4ac5b8b0f2b74fdfd14c893a45192015c7c233697778c8 |
|
MD5 | a81957badee0a4549a9882ed4a028b65 |
|
BLAKE2b-256 | 53fac6ec3c86d17497e772ea321a8f56aba7afcbba2c1379a8236435c2a13be9 |
Hashes for pillow_jpls-0.1.dev1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 442ecbed1a63a02106972d577bfd86c1988543f76f275e8abcde5ea4c53bcc24 |
|
MD5 | c27f2ca68764bb3558f763b32d11e63b |
|
BLAKE2b-256 | 2a317858f148160037e99d81d8758ab9eeda3e1b8f1881c47b34f78eadff4008 |
Hashes for pillow_jpls-0.1.dev1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5954f1a2a62f8645aea35c7be92eac33a546e12fa455c9e00f42a8a5a56b822 |
|
MD5 | d682ae1e13ff6e2b045b4930d9186697 |
|
BLAKE2b-256 | 7dbc18a7ea2e62f3c6e1ef59a645aa55aa052ef8e62c8c91e0d687751c8cd4b8 |
Hashes for pillow_jpls-0.1.dev1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e90787c72ac048f3d7b286b34b302c63b6d8e40c00762da6072efbefec24d79 |
|
MD5 | cc3b97accafb8bf49e50c991fe701e29 |
|
BLAKE2b-256 | 0b6db509b99c7355475612faa5fcf2a26105d408d809d9a25fccf62fdd1bc862 |
Hashes for pillow_jpls-0.1.dev1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7c167b4c87658ced1e2ea0ee568a02814959a0569f7bff0ae6fb8c502707099 |
|
MD5 | 37c6177f8475b02005e68e1a6c7ca188 |
|
BLAKE2b-256 | f976b7c3452bedd310cb8a497d5dde932e5ba043d04bcc13739545f2c55794d2 |
Hashes for pillow_jpls-0.1.dev1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0adb0c2d653cf71090e24473cca3ae766abfbf52d5784843fa522eccc6523033 |
|
MD5 | 0cf819974159e6cffd527a9b4074af9c |
|
BLAKE2b-256 | 4b1b07b932a568576e2b1cb77e206cf01006cb4e1da81bc32897b668fd14848c |
Hashes for pillow_jpls-0.1.dev1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5450aa190e9d016c35bc362237958a6f3f7575d181a16691bea38b84caf8e616 |
|
MD5 | ce787ff1d9e5c78b99a5b793caff27ee |
|
BLAKE2b-256 | 5e173c87d494723eb86ac401d4c7a6c7530d879cbf999fb08b642073523c04ac |
Hashes for pillow_jpls-0.1.dev1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d7adc077eaba5a1525d361a804e3a8c6ec803085a06ebfc2f5b3734a92c759b |
|
MD5 | 99d655fa41046b5a1a5405dd589cee12 |
|
BLAKE2b-256 | e51a920238faf1fb4a14c121e063e1f6c38a0352053a44ba261e2f4352ba8876 |
Hashes for pillow_jpls-0.1.dev1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 166b4426833fc071ec2d07842ae330f7c6230fdff741a5a6c16bd470bf9fd3fa |
|
MD5 | f0f176c0e2b149b816ddcc5726802963 |
|
BLAKE2b-256 | 110ad1308f406a16efa68116672007393386033da11fdf56ae4c32630bd3ab42 |
Hashes for pillow_jpls-0.1.dev1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d67a81806f1b0cc2ed9f80e3f128987abf0f394bceab4304e4e792396d8b3c6f |
|
MD5 | f19b6f8cbdbe86177c4a28d34e66396e |
|
BLAKE2b-256 | a05231fa659cec84843c9153968dbb86981533a40e813872be2ac468728bd788 |
Hashes for pillow_jpls-0.1.dev1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24c2c3be54be6c494613e9b0ef98300e4ebef09a4eca71845079d92f4c7ccc3 |
|
MD5 | 8e4bee8567c14c31fe66361ff0906d02 |
|
BLAKE2b-256 | ea6c992940209330d654f4638464e3ac5d3f2f63169d282fbf85451b13af1321 |
Hashes for pillow_jpls-0.1.dev1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523c509634f2b62a58c1e661fb2945d53936df5d20882cbc28409013f606cba5 |
|
MD5 | 057fb1188ba4ada99614fca3d682dfa6 |
|
BLAKE2b-256 | 5c545a6980fee4abbd37614126145e794a9f08605977993ac53ab9a8b67dcbb8 |