Skip to content

3.7.0

Choose a tag to compare

@matmen matmen released this 26 Oct 07:24
· 65 commits to master since this release
Immutable release. Only release title and notes can be modified.

This release encodes lossy JPEG XLs, makes lossless WebPs and the alpha of lossy ones smaller, and decodes lossy JPEG XLs about 15% faster. Like every codec in ImageScript, it's plain TypeScript: no WebAssembly and no native code. There are no breaking API changes.

await image.encodeJXL();                          // lossless, as before
await image.encodeJXL({ quality: 90 });           // lossy, like cjxl -q 90
await image.encodeJXL({ quality: 75, effort: 2 });

New

Lossy JPEG XL encoding

encodeJXL({ quality, effort }) encodes lossy JPEG XLs (VarDCT) when given a quality. Without it, images are encoded losslessly as before.

  • quality (0-100) maps to the Butteraugli distance like cjxl -q: 90 is cjxl's default, 100 is lossless
  • effort (0-2, default 1): 1 chooses the transforms' sizes like libjxl's effort 5 (from 4x4 up to 64x64, chroma from luma per tile), 2 also tries the 4x8 and AFV transforms, 0 uses 8x8 DCTs only (like effort 3)
  • Alpha is lossless
  • Compression: at the same SSIMULACRA2 score the files are about 1.5% smaller than cjxl -e 5's at effort 1 (3.5% at effort 2), and within 1-4% of cjxl -e 7's, the default (up to 9% for screenshots)
  • Speed: a 1920x1080 photo takes about 1 s at effort 0, 5 s at effort 1, 10 s at effort 2

Improvements

  • Lossless WebP files are about 6% smaller (within about 7% of cwebp's), the alpha of lossy WebPs about 17% (at the default effort smaller than cwebp's): blocks are grouped by their statistics with prefix codes per group, the color cache's size is chosen, matches look one pixel ahead, smooth alpha is predicted instead of indexed. Lossless encoding takes about 65% longer

Performance

  • JPEG XL decoding of lossy images is about 15% faster (2048x1536: 0.73 s instead of 0.87 s), with identical results
  • AVIF encoding is about 8% faster, with files about as large as before

Fixes

  • AVIFEncodeOptions is exported, with the new JXLEncodeOptions