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 Distribution
Built Distributions
Hashes for pillow_jpls-1.3.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4759aea212a368b541501f0238780c2849618a1cdefd039a344fbf525d2d1af |
|
MD5 | 97fb6121660ad12bc0d40acdaefec924 |
|
BLAKE2b-256 | e270aea33182b36f03aa637be722f13baf285ef8b718c1003f407a5fc976e267 |
Hashes for pillow_jpls-1.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23fbce9a1007acf72a19afb834589a1903ab4bc46a425a6237f5923c16f41c59 |
|
MD5 | 4a09d74062be565df126e1ccf38d1e05 |
|
BLAKE2b-256 | 3caa9040de70f0b1d50fd1779256d274d3af59f762788998360fdf9aa1fd96b0 |
Hashes for pillow_jpls-1.3.1-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd0e52b4977ed1bc2727b9621d52a7f069a2d76f99b8e21a0e0644ed03398299 |
|
MD5 | 2e43b8eb6ca996a322dad7f4a6aa3e7b |
|
BLAKE2b-256 | bedc962f4a339f8280aaf5f38025d08d9072874e7db54fb38aca62432cf88231 |
Hashes for pillow_jpls-1.3.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1a6580fae547e079f057ad6c6f20ccf74540f6e1aacaf307c3ad0bba1aaaa2 |
|
MD5 | f7703b1a8ed812ff0c152dcb578abf96 |
|
BLAKE2b-256 | 53d1b76f7dce04216d1578e46e2da17a0f13fbf6d90eee11f0fe9099bf2bf0ef |
Hashes for pillow_jpls-1.3.1-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4933d087695652e5f5ae468197dd0b72a7f2ccbb0d7941b8d88d6e801594adc |
|
MD5 | e025c3447a5dccbeefb3ae34e177151e |
|
BLAKE2b-256 | 1ab374b1c6c56b3f8dd4a1c7d275bf7052632ca1e66ff7968b3d5112abc7f593 |
Hashes for pillow_jpls-1.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a29127fd2121e73e8402055fa1452bcb5d7972596a6c29823a43c39395228a |
|
MD5 | 4917a915ded1528cfdffce9c6ca5035c |
|
BLAKE2b-256 | 2cdc97291eb5da49072622904594994242ae4e590b5a81a43ac1e0e25d832ff2 |
Hashes for pillow_jpls-1.3.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3bb473e6b67b87b04d78704bd46f3ab7d2f4e9a8fae78e354a10b3ebb18fa75 |
|
MD5 | 4d0a91125debea063b4df16f36e5ac8c |
|
BLAKE2b-256 | a307125f2d962c9f973f2ebad5af47e899149f233e54c740745c679050f9dc7e |
Hashes for pillow_jpls-1.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1eb0f804d707631727010e667d5126638e9ba90b7c2933bfbb2e6cbff784681c |
|
MD5 | c2e4e3417ab9374f88925db1666def5d |
|
BLAKE2b-256 | fd387e8b4491c3eca44154efd2da61d562600064c9251cc81e4e4273f0cd2f40 |
Hashes for pillow_jpls-1.3.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e038022dc4b79eda2be8f4b47a4ff3ccb38be45deccb21a1d9c4f63930a09e |
|
MD5 | 03ec5ede687bf62e3c30af94e06c6a4e |
|
BLAKE2b-256 | 135bfb54125937af0d97f4421ffdbb1200feb57cfdc40bd35e1b45bc2e067dcd |
Hashes for pillow_jpls-1.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aba3ac539595f6de13fb2e2500b85f9df0e63acf609904af93e177bb95af87f9 |
|
MD5 | a826246254f0963e52d38c0aa8469530 |
|
BLAKE2b-256 | 09cc45644ff48389d55b9f81781faab8f0dd0345b08f542b5304af5cbf460e62 |
Hashes for pillow_jpls-1.3.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a33fb7d4b81f27a909542464855e897369ac59c691e311170c507d7ea4a2d55 |
|
MD5 | cf76203d4de33a942b08806c2c410eb2 |
|
BLAKE2b-256 | 50ec08cf8270b3495926da635c4ec928abdbf42560875bafe813ca29564c401f |
Hashes for pillow_jpls-1.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3c2759e669c5c583948f5cc19f9fb17de2ec48a3ebdbdc4729de07691bc9644 |
|
MD5 | 9d5d5ec3f8a6b307b04e5eced8ea0b68 |
|
BLAKE2b-256 | 237db8c047a8fe579c2c3c843b888eda59f9866143beab1adbb0a86e096af757 |
Hashes for pillow_jpls-1.3.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc86147be789c9655af34a328a20899f54b77fb49cd03f2a3d225c093fd6e421 |
|
MD5 | 2f3c44a7f0c506a9f10c317a795d23d7 |
|
BLAKE2b-256 | 01ca631f7e028077602baf98beb836e9c134ffb637a8c0359d480a241ee7d9d8 |
Hashes for pillow_jpls-1.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3f379ab4452436f29064eba854993bb429babfd747a9f7071ba6707b957306 |
|
MD5 | 152abb87242962f982bbf8951e340bbe |
|
BLAKE2b-256 | 924952c8921d8678ed863ab49fd409c82c5dd3ce696a3e5be1a22c51debe4458 |
Hashes for pillow_jpls-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf84716864d18bb1251e43f080258a4fa5228bd6d0d591e8e718fcaf62701373 |
|
MD5 | e71b0a62b6cf52e729960a33eb841f52 |
|
BLAKE2b-256 | b351dbb850445eac5e017fa7d7086bedc77820b847bcc1eacb336e83af995c04 |
Hashes for pillow_jpls-1.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e90bcb957be0918fb2a9acfe2c99496820839e62c899628026d133f5025fcc2 |
|
MD5 | f503be9776f2486191ae807a087b32b3 |
|
BLAKE2b-256 | 9162aede63a8243af941fbb45a4909b1dfda9c81240438c6c662e8c443fff264 |
Hashes for pillow_jpls-1.3.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbefbc603dfdbf2b59f6c81e9b79540fc465e08d2b4b9368ecf10903d87a5738 |
|
MD5 | 32d81c6119f1651e4aa2af617983d2f9 |
|
BLAKE2b-256 | 6c73373fd6f279e2b8e9b670398428d8bdff6772a3508f17cb8b5aeb4a63158d |
Hashes for pillow_jpls-1.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdb597a2749b9cd6e29de9be9420fafdeb26c4c2ba1a368928750220ea4de7fc |
|
MD5 | dd2e75b8da5bb96d15a741953e90b048 |
|
BLAKE2b-256 | b402742b26137fffe66e4a86fff06a2e5ca9fe7856c137b8463e38cf719f442e |
Hashes for pillow_jpls-1.3.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6894ebe3c5e50cbc517fd6e21974b37efd9071b5dc4c8457ef4a6aaf3d033c03 |
|
MD5 | 38b6d51a5f22136a333ace8f85f7f313 |
|
BLAKE2b-256 | ad909c424beed3d52f88e5e8ab16f0de59adbfb54f50322f378427eb12f5fd40 |