Repository navigation
3.6.0
·
57 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
This release writes metadata into AVIFs and JPEG XLs, makes PNGs of graphics up to 30% smaller and lossy WebP encoding about four times faster by default. There are no breaking API changes.
await image.encodeAVIF({ metadata: { author: 'me', description: 'a cat' } });
await image.encodeJXL({ metadata: { software: '' } }); // without the software tag
await image.encodeWebP({ quality: 75 }); // effort 2 now, about 250 ms for 1920x1080
await image.encodeWebP({ quality: 75, effort: 4 }); // like cwebp's default, as beforeNew
Metadata in AVIF and JPEG XL
encodeAVIF() and encodeJXL() take metadata like the other encoders: author, description, copyright, creation time and software (by default ImageScript and its version) as Exif.
- AVIF: an Exif item that describes the image, like libavif writes it
- JPEG XL: the codestream goes into the container, with an Exif box. The codestream is still byte for byte what
cjxl -e 1writes. As the creation time is always written, JPEG XLs are now always in the container (about 250 bytes more), like JPEGs and WebPs always have Exif
Improvements
- PNG (and APNG): rows are left unfiltered when that compresses better than the paeth filter, as it often does for graphics and screenshots: their files are up to 30% smaller, and encoded faster. Photos are encoded as before, about 8% slower
- Lossy WebP defaults to
effort: 2instead of 4: about a quarter of the time (about 250 ms instead of 900 ms for a 1920×1080 photo) for files about 5% larger, at a slightly lower quality (about 0.5 dB PSNR).effort: 4still encodes byte for byte like cwebp's default - AVIF encoding also splits blocks into halves where that pays off: files about 2% smaller at the default effort, about 20% slower.
effort: 2also chooses smaller transforms within blocks: about 1% smaller (up to 4% for graphics)
Performance
- Lossy WebP with
effort3 to 6 is about 25% faster, with byte for byte the same files