Docs: changelog and refresh for #2789

This commit is contained in:
Lovell Fuller 2021-12-11 21:41:41 +00:00
parent 513fb40f40
commit 8c0660d71e
4 changed files with 14 additions and 9 deletions

View File

@ -283,9 +283,8 @@ Use these WebP options for output image.
* `options.nearLossless` **[boolean][7]** use near_lossless compression mode (optional, default `false`) * `options.nearLossless` **[boolean][7]** use near_lossless compression mode (optional, default `false`)
* `options.smartSubsample` **[boolean][7]** use high quality chroma subsampling (optional, default `false`) * `options.smartSubsample` **[boolean][7]** use high quality chroma subsampling (optional, default `false`)
* `options.effort` **[number][9]** CPU effort, between 0 (fastest) and 6 (slowest) (optional, default `4`) * `options.effort` **[number][9]** CPU effort, between 0 (fastest) and 6 (slowest) (optional, default `4`)
* `options.pageHeight` **[number][9]?** page height for animated output
* `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`) * `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`)
* `options.delay` **[Array][10]<[number][9]>?** list of delays between animation frames (in milliseconds) * `options.delay` **([number][9] | [Array][10]<[number][9]>)?** delay(s) between animation frames (in milliseconds)
* `options.force` **[boolean][7]** force WebP output, otherwise attempt to use input format (optional, default `true`) * `options.force` **[boolean][7]** force WebP output, otherwise attempt to use input format (optional, default `true`)
### Examples ### Examples
@ -322,9 +321,8 @@ The first entry in the palette is reserved for transparency.
* `options.colors` **[number][9]** alternative spelling of `options.colours` (optional, default `256`) * `options.colors` **[number][9]** alternative spelling of `options.colours` (optional, default `256`)
* `options.effort` **[number][9]** CPU effort, between 1 (fastest) and 10 (slowest) (optional, default `7`) * `options.effort` **[number][9]** CPU effort, between 1 (fastest) and 10 (slowest) (optional, default `7`)
* `options.dither` **[number][9]** level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default `1.0`) * `options.dither` **[number][9]** level of Floyd-Steinberg error diffusion, between 0 (least) and 1 (most) (optional, default `1.0`)
* `options.pageHeight` **[number][9]?** page height for animated output
* `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`) * `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`)
* `options.delay` **[Array][10]<[number][9]>?** list of delays between animation frames (in milliseconds) * `options.delay` **([number][9] | [Array][10]<[number][9]>)?** delay(s) between animation frames (in milliseconds)
* `options.force` **[boolean][7]** force GIF output, otherwise attempt to use input format (optional, default `true`) * `options.force` **[boolean][7]** force GIF output, otherwise attempt to use input format (optional, default `true`)
### Examples ### Examples
@ -350,10 +348,7 @@ const gif = await sharp('animated.gif', { animated: true })
width: 128, width: 128,
height: 128 * pages height: 128 * pages
}) })
.gif({ .gif({ dither: 0 })
pageHeight: 128,
dither: 0
})
.toBuffer(); .toBuffer();
``` ```
@ -361,6 +356,10 @@ const gif = await sharp('animated.gif', { animated: true })
Returns **Sharp** Returns **Sharp**
**Meta**
* **since**: 0.30.0
## jp2 ## jp2
Use these JP2 options for output image. Use these JP2 options for output image.

View File

@ -17,6 +17,10 @@ Requires libvips v8.12.1
* Expose control over CPU effort for palette-based PNG output. * Expose control over CPU effort for palette-based PNG output.
[#2541](https://github.com/lovell/sharp/issues/2541) [#2541](https://github.com/lovell/sharp/issues/2541)
* Improve animated (multi-page) image resize and extract.
[#2789](https://github.com/lovell/sharp/pull/2789)
[@kleisauke](https://github.com/kleisauke)
* Ensure 16-bit PNG output uses correct bitdepth. * Ensure 16-bit PNG output uses correct bitdepth.
[#2958](https://github.com/lovell/sharp/pull/2958) [#2958](https://github.com/lovell/sharp/pull/2958)
[@gforge](https://github.com/gforge) [@gforge](https://github.com/gforge)

File diff suppressed because one or more lines are too long

View File

@ -507,6 +507,8 @@ function webp (options) {
* *
* The first entry in the palette is reserved for transparency. * The first entry in the palette is reserved for transparency.
* *
* @since 0.30.0
*
* @example * @example
* // Convert PNG to GIF * // Convert PNG to GIF
* await sharp(pngBuffer) * await sharp(pngBuffer)