JPEG XL libraries for Python
Pillow has no built-in JPEG XL support. Two good options:
- pillow-jxl-plugin adds JXL to Pillow: after
import pillow_jxl,Image.openandImage.savehandle.jxl, including lossless JPEG recompression. Binary wheels include libjxl. It’s GPL-3.0, which matters if you distribute your program. - pyvips binds libvips, which reads and writes JXL through libjxl. It’s fast and uses little memory, and is the better choice for batch conversion and large images. MIT licensed.
imagecodecs (BSD-3-Clause) also has jpegxl_encode and jpegxl_decode functions that work on NumPy arrays.
- pillow-jxl-plugin pillow-jxl-plugin adds JPEG XL support to Pillow in Python. Open and save JXL files, set quality, effort and lossless mode, and recompress JPEG losslessly.
- pyvips pyvips reads and writes JPEG XL images in Python through libvips and libjxl. Install it, convert to and from JXL, set quality, distance, effort and lossless.