Skip to content

3.11.0

Choose a tag to compare

@matmen matmen released this 30 Oct 07:34
· 58 commits to master since this release
Immutable release. Only release title and notes can be modified.

This release converts JPEG XLs with an embedded ICC color profile to sRGB when decoding, like PNG, JPEG, WebP, AVIF and TIFF already were, and fixes the JSR package: 3.10.0 only made it to npm. There are no breaking API changes, but decoded pixels of JPEG XLs with a non-sRGB profile change (see below).

await Image.decode(losslessP3Jxl);                              // now converted from Display P3 to sRGB
await Image.decode(losslessP3Jxl, { applyColorProfile: false }); // the stored values, as before

JPEG XL color profiles

JPEG XLs whose pixels are stored in their embedded profile's color space (lossless ones, and JPEGs recompressed with cjxl) are converted to sRGB, in Image.decode() and Animation.decode(), the way browsers display them.

  • The profile is decoded from JPEG XL's compressed ICC stream (ported from jxl-oxide), byte for byte the profile libjxl reads
  • It's applied like the other formats' profiles: matrix/TRC profiles relative colorimetric, within 1 of LittleCMS; profiles with only lookup tables, CMYK and sRGB profiles leave the pixels as they are
  • Lossy (XYB) JPEG XLs already decoded to sRGB; their profile only describes what the image was before encoding, so they stay the same
  • applyColorProfile: false keeps the stored values

Fixes

  • 3.10.0 is on npm but JSR refused it (a global type declaration for import.meta.url), so JSR's latest was still 3.9.0. 3.11.0 is on both, with everything from 3.10.0: worker threads for AVIF, JPEG XL and lossless WebP, and the faster SVG rasterizer (release notes). The release check now catches this before anything is published.

See the changelog for the details.