Skip to main content

A JPEG-LS plugin for the Pillow imaging library

Project description

JPEG-LS plugin for Python Pillow

Build status

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 of none, line or sample
  • bits_per_component : override the number of bits encoded per component, otherwise taken from the image format
  • maxval: override the maximum value of any component, otherwise taken from bits_per_component
  • t1
  • t2
  • t3
  • reset
  • spiff: Use a SPIFF image header, generated by default. Use None 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pillow_jpls-1.3.2.tar.gz (818.0 kB view hashes)

Uploaded Source

Built Distributions

pillow_jpls-1.3.2-cp312-cp312-win_amd64.whl (200.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pillow_jpls-1.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pillow_jpls-1.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (305.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pillow_jpls-1.3.2-cp312-cp312-macosx_11_0_arm64.whl (221.6 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pillow_jpls-1.3.2-cp312-cp312-macosx_10_15_x86_64.whl (232.7 kB view hashes)

Uploaded CPython 3.12 macOS 10.15+ x86-64

pillow_jpls-1.3.2-cp311-cp311-win_amd64.whl (200.7 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pillow_jpls-1.3.2-cp311-cp311-win32.whl (172.3 kB view hashes)

Uploaded CPython 3.11 Windows x86

pillow_jpls-1.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (307.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pillow_jpls-1.3.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (339.3 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

pillow_jpls-1.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (307.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pillow_jpls-1.3.2-cp311-cp311-macosx_11_0_arm64.whl (222.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pillow_jpls-1.3.2-cp311-cp311-macosx_10_15_x86_64.whl (231.5 kB view hashes)

Uploaded CPython 3.11 macOS 10.15+ x86-64

pillow_jpls-1.3.2-cp310-cp310-win_amd64.whl (199.6 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pillow_jpls-1.3.2-cp310-cp310-win32.whl (171.3 kB view hashes)

Uploaded CPython 3.10 Windows x86

pillow_jpls-1.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pillow_jpls-1.3.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (338.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

pillow_jpls-1.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (305.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pillow_jpls-1.3.2-cp310-cp310-macosx_11_0_arm64.whl (220.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pillow_jpls-1.3.2-cp310-cp310-macosx_10_15_x86_64.whl (230.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pillow_jpls-1.3.2-cp39-cp39-win_amd64.whl (197.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pillow_jpls-1.3.2-cp39-cp39-win32.whl (171.5 kB view hashes)

Uploaded CPython 3.9 Windows x86

pillow_jpls-1.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pillow_jpls-1.3.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (338.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

pillow_jpls-1.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (305.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pillow_jpls-1.3.2-cp39-cp39-macosx_11_0_arm64.whl (220.9 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pillow_jpls-1.3.2-cp39-cp39-macosx_10_15_x86_64.whl (230.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pillow_jpls-1.3.2-cp38-cp38-win_amd64.whl (199.7 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pillow_jpls-1.3.2-cp38-cp38-win32.whl (171.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

pillow_jpls-1.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (305.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pillow_jpls-1.3.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (337.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

pillow_jpls-1.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (305.6 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pillow_jpls-1.3.2-cp38-cp38-macosx_11_0_arm64.whl (220.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pillow_jpls-1.3.2-cp38-cp38-macosx_10_15_x86_64.whl (230.0 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page