Add JPEG XL (JXL) encoder - #115
Merged
Merged
Conversation
Encodes JXL through libvips' jxlsave, mirroring the AVIF and HEIC encoders. libvips has a native lossless flag, but JXL has no separate lossless setting beyond maximum quality, so it is enabled at Q 100 like the sibling encoders. LoaderDetector now maps the jxl loader to Format::JXL so the driver reports JXL support when libvips is built with libjxl. The Dockerfile and CI workflow install libjxl-dev so the source-built libvips includes the JXL loader and saver. JXL support requires intervention/image 4.2.0, so the constraint is bumped to ^4.2.
Member
|
Great. Thanks. |
Member
|
Released in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds JPEG XL as an encodable format in the vips driver.
It follows the
AvifEncoderandHeicEncoder. Encoding goes through libvips'jxlsaveviawriteToBuffer('.jxl', ...). libvips'jxlsavehas a nativelosslessflag, but JXL has no separate lossless setting beyond maximum quality, so I enable it atQ100, same as the AVIF and HEIC encoders here.LoaderDetectornow maps thejxlloader toFormat::JXL. Without that,supports(Format::JXL)returns false even when libvips has the loader.For CI and Docker I added
libjxl-devto the apt list. Both build libvips from source, and libvips enables JXL when libjxl is present at build time. Both bases (Debian for theDockerfile,ubuntu-24.04for CI) havelibjxl-devin apt.This needs the JXL support from core, so it requires
intervention/image^4.2(JXL shipped in 4.2.0).I ran the suite in Docker against libvips 8.18.1 built with libjxl, all green. The
JxlEncodertest does a realjxlsave, and the driver reportssupports(Format::JXL).