mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 10:30:15 +02:00
Docs: add animated WebP example #2648
This commit is contained in:
parent
cd410080bd
commit
08a25a0c8f
@ -267,6 +267,13 @@ const data = await sharp(input)
|
||||
.toBuffer();
|
||||
```
|
||||
|
||||
```javascript
|
||||
// Optimise the file size of an animated WebP
|
||||
const outputWebp = await sharp(inputWebp, { animated: true })
|
||||
.webp({ reductionEffort: 6 })
|
||||
.toBuffer();
|
||||
```
|
||||
|
||||
- Throws **[Error][4]** Invalid options
|
||||
|
||||
Returns **Sharp**
|
||||
|
File diff suppressed because one or more lines are too long
@ -383,6 +383,12 @@ function png (options) {
|
||||
* .webp({ lossless: true })
|
||||
* .toBuffer();
|
||||
*
|
||||
* @example
|
||||
* // Optimise the file size of an animated WebP
|
||||
* const outputWebp = await sharp(inputWebp, { animated: true })
|
||||
* .webp({ reductionEffort: 6 })
|
||||
* .toBuffer();
|
||||
*
|
||||
* @param {Object} [options] - output options
|
||||
* @param {number} [options.quality=80] - quality, integer 1-100
|
||||
* @param {number} [options.alphaQuality=100] - quality of alpha layer, integer 0-100
|
||||
|
Loading…
x
Reference in New Issue
Block a user