Add WebP 'exact' option for control over transparent pixels

This commit is contained in:
Lovell Fuller
2026-01-01 19:19:20 +00:00
parent 1cf4b7f04d
commit 0d872bd13a
9 changed files with 47 additions and 4 deletions

View File

@@ -563,6 +563,7 @@ Use these WebP options for output image.
| [options.delay] | <code>number</code> \| <code>Array.&lt;number&gt;</code> | | delay(s) between animation frames (in milliseconds) |
| [options.minSize] | <code>boolean</code> | <code>false</code> | prevent use of animation key frames to minimise file size (slow) |
| [options.mixed] | <code>boolean</code> | <code>false</code> | allow mixture of lossy and lossless animation frames (slow) |
| [options.exact] | <code>boolean</code> | <code>false</code> | preserve the colour data in transparent pixels |
| [options.force] | <code>boolean</code> | <code>true</code> | force WebP output, otherwise attempt to use input format |
**Example**

View File

@@ -23,3 +23,5 @@ slug: changelog/v0.35.0
* Add `toUint8Array` for output image as a `TypedArray` backed by a transferable `ArrayBuffer`.
[#4355](https://github.com/lovell/sharp/issues/4355)
* Add WebP `exact` option for control over transparent pixel colour values.