Open
Description
π Feature Request
Suppory JPEG XL as an output format for images.
π€ Expected Behavior
JPEG XL works
π― Current Behavior
JPEG XL does not work
π Possible Solution
Support JPEG XL.
π¦ Context
Supporting JPEG XL requires sharp β₯0.31.3, as well as a custom lib-vips build.
See: https://sharp.pixelplumbing.com/api-output#jxl
supporting this should be somewhat straightforward and only require adding one (or two) lines to packages/transformers/image/src/ImageTransformer.js
:
const FORMATS = new Map([
['jpeg', 'jpeg'],
['jpg', 'jpeg'],
['png', 'png'],
['webp', 'webp'],
['gif', 'gif'],
['tiff', 'tiff'],
['avif', 'avif'],
['heic', 'heif'],
['heif', 'heif'],
+ ['jpegxl', 'jxl'],
+ ['jxl', 'jxl'],
]);
π» Examples
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>HTML Example</title>
</head>
<body>
<picture>
<source srcset="image.jpeg?as=avif&width=800" type="image/avif" />
<source srcset="image.jpeg?as=jxl&width=800" type="image/jxl" />
<source srcset="image.jpeg?as=webp&width=800" type="image/webp" />
<source srcset="image.jpeg?width=800" type="image/jpeg" />
<img src="image.jpeg?width=200" alt="test image" />
</picture>
</body>
</html>
Metadata
Metadata
Assignees
Labels
No labels