Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pillow-jpls

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pillow-jpls

A JPEG-LS plugin for the Pillow imaging library

  • 1.3.2
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc