Skip to content

3.12.1

Choose a tag to compare

@matmen matmen released this 30 Oct 23:40
Immutable release. Only release title and notes can be modified.

This release makes lossless WebP files smaller, especially for graphics, screenshots and images with transparency. There are no API changes.

await image.encodeWebP();   // lossless: the benchmark graphic now takes 277 kB instead of 557 kB

Lossless WebP

  • Transforms chosen by entropy analysis: like libwebp, the encoder now estimates whether the predictor and subtracting green pay off instead of always predicting. Graphics with flat areas and repeated parts compress much better without the predictor: the 1434x1434 benchmark graphic takes 277 kB instead of 557 kB (cwebp: 278 kB), screenshots and images with transparency 15-30% less. Photos stay the same.
  • Color transform: after the predictor, red and blue are predicted from green per 32x32 block, like libwebp does. Emoji and rendered graphics get 5-6% smaller, about 0.6% on average, at about 9% more encoding time.

Over 39 test images, our lossless WebP bitstreams went from 1.11 to 1.04 times the size of cwebp's (-m 4 -q 75, sharp's default). As before, all of it is plain TypeScript: no WebAssembly and no native code.

Documentation

The documentation moved to imagescript.dev. Links to imagescript.matmen.dev redirect there.

See the changelog for the details.