Docs: add animated WebP example #2648

This commit is contained in:
Lovell Fuller
2021-04-01 16:04:46 +01:00
parent cd410080bd
commit 08a25a0c8f
3 changed files with 14 additions and 1 deletions

View File

@@ -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