Pillow plugin for adding JPEG-XL (JXL) image format support, leveraging Rust bindings for performance. It seamlessly integrates with Pillow's `Image.open()` and `Image.save()` methods. The library is actively maintained with frequent minor releases, often addressing CI improvements, dependency updates, and adding new JXL features like float16 decode and EXIF support.
pip install pillow-jxl-pluginVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to open and save JPEG-XL images using the standard Pillow API. The `pillow-jxl-plugin` integrates directly, so no special JXL-specific functions are called; simply use `Image.open()` and `Image.save()` with `.jxl` file extensions.
Ensure you have the Rust toolchain installed (e.g., via `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`) or use a supported environment with pre-built wheels.
Ensure your Python environment is 3.9 or newer. Upgrade your Python installation if necessary.
Refer to the library's GitHub README or documentation for a list of supported modes and features. If encountering issues, convert the image to a broadly supported mode (e.g., `RGB`) before saving or loading if possible, or report an issue to the maintainers.
For explicit control over metadata compression during saving, use the `metadata_compress` argument (e.g., `img.save('output.jxl', metadata_compress=True/False)`). Check the latest documentation for current defaults and options.Ensure `pillow-jxl-plugin` is installed: `pip install pillow-jxl-plugin`. Verify it's installed in the correct environment. Also, confirm the file is a valid JXL image.
Install the Rust toolchain by following instructions on `rustup.rs` (e.g., `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`). Ensure your `PATH` includes cargo's bin directory. Alternatively, try upgrading `pip` or using a `manylinux` compatible environment if on Linux.
Try converting the image to a more universally supported mode like `RGB` before saving (`img.convert('RGB').save('output.jxl', ...)`). If the issue persists, ensure you are using the latest version of the plugin and report the specific error with image details to the project's GitHub issues.