Bump deps and docs refresh

This commit is contained in:
Lovell Fuller 2021-05-03 10:01:43 +01:00
parent 9c06df08a1
commit cac83b94c1
11 changed files with 397 additions and 352 deletions

View File

@ -25,7 +25,7 @@ This is a no-op if the image already has an alpha channel.
### Parameters ### Parameters
- `alpha` **[number][1]** alpha transparency level (0=fully-transparent, 1=fully-opaque) (optional, default `1`) * `alpha` **[number][1]** alpha transparency level (0=fully-transparent, 1=fully-opaque) (optional, default `1`)
### Examples ### Examples
@ -43,13 +43,13 @@ const rgba = await sharp(rgb)
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][2]** Invalid alpha transparency level * Throws **[Error][2]** Invalid alpha transparency level
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.21.2 * **since**: 0.21.2
## extractChannel ## extractChannel
@ -57,7 +57,7 @@ Extract a single channel from a multi-channel image.
### Parameters ### Parameters
- `channel` **([number][1] \| [string][3])** zero-indexed channel/band number to extract, or `red`, `green`, `blue` or `alpha`. * `channel` **([number][1] | [string][3])** zero-indexed channel/band number to extract, or `red`, `green`, `blue` or `alpha`.
### Examples ### Examples
@ -71,7 +71,7 @@ sharp(input)
}); });
``` ```
- Throws **[Error][2]** Invalid channel * Throws **[Error][2]** Invalid channel
Returns **Sharp** Returns **Sharp**
@ -82,19 +82,20 @@ The meaning of the added channels depends on the output colourspace, set with `t
By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels. By default the output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.
Channel ordering follows vips convention: Channel ordering follows vips convention:
- sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. * sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha.
- CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. * CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha.
Buffers may be any of the image formats supported by sharp. Buffers may be any of the image formats supported by sharp.
For raw pixel input, the `options` object should contain a `raw` attribute, which follows the format of the attribute of the same name in the `sharp()` constructor. For raw pixel input, the `options` object should contain a `raw` attribute, which follows the format of the attribute of the same name in the `sharp()` constructor.
### Parameters ### Parameters
- `images` **([Array][4]&lt;([string][3] \| [Buffer][5])> | [string][3] \| [Buffer][5])** one or more images (file paths, Buffers). * `images` **([Array][4]<([string][3] | [Buffer][5])> | [string][3] | [Buffer][5])** one or more images (file paths, Buffers).
- `options` **[Object][6]** image options, see `sharp()` constructor. * `options` **[Object][6]** image options, see `sharp()` constructor.
<!---->
- Throws **[Error][2]** Invalid parameters * Throws **[Error][2]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -104,7 +105,7 @@ Perform a bitwise boolean operation on all input image channels (bands) to produ
### Parameters ### Parameters
- `boolOp` **[string][3]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively. * `boolOp` **[string][3]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
### Examples ### Examples
@ -118,7 +119,7 @@ sharp('3-channel-rgb-input.png')
}); });
``` ```
- Throws **[Error][2]** Invalid parameters * Throws **[Error][2]** Invalid parameters
Returns **Sharp** Returns **Sharp**

View File

@ -7,10 +7,11 @@ An alpha channel may be present and will be unchanged by the operation.
### Parameters ### Parameters
- `rgb` **([string][1] \| [Object][2])** parsed by the [color][3] module to extract chroma values. * `rgb` **([string][1] | [Object][2])** parsed by the [color][3] module to extract chroma values.
<!---->
- Throws **[Error][4]** Invalid parameter * Throws **[Error][4]** Invalid parameter
Returns **Sharp** Returns **Sharp**
@ -25,7 +26,7 @@ An alpha channel may be present, and will be unchanged by the operation.
### Parameters ### Parameters
- `greyscale` **[Boolean][5]** (optional, default `true`) * `greyscale` **[Boolean][5]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -35,7 +36,7 @@ Alternative spelling of `greyscale`.
### Parameters ### Parameters
- `grayscale` **[Boolean][5]** (optional, default `true`) * `grayscale` **[Boolean][5]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -46,7 +47,7 @@ By default output image will be web-friendly sRGB, with additional channels inte
### Parameters ### Parameters
- `colourspace` **[string][1]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][6] * `colourspace` **[string][1]?** output colourspace e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][6]
### Examples ### Examples
@ -57,7 +58,7 @@ await sharp(input)
.toFile('16-bpp.png') .toFile('16-bpp.png')
``` ```
- Throws **[Error][4]** Invalid parameters * Throws **[Error][4]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -67,10 +68,11 @@ Alternative spelling of `toColourspace`.
### Parameters ### Parameters
- `colorspace` **[string][1]?** output colorspace. * `colorspace` **[string][1]?** output colorspace.
<!---->
- Throws **[Error][4]** Invalid parameters * Throws **[Error][4]** Invalid parameters
Returns **Sharp** Returns **Sharp**

View File

@ -19,24 +19,28 @@ and [https://www.cairographics.org/operators/][2]
### Parameters ### Parameters
- `images` **[Array][3]&lt;[Object][4]>** Ordered list of images to composite * `images` **[Array][3]<[Object][4]>** Ordered list of images to composite
- `images[].input` **([Buffer][5] \| [String][6])?** Buffer containing image data, String containing the path to an image file, or Create object (see below)
- `images[].input.create` **[Object][4]?** describes a blank overlay to be created. * `images[].input` **([Buffer][5] | [String][6])?** Buffer containing image data, String containing the path to an image file, or Create object (see below)
- `images[].input.create.width` **[Number][7]?**
- `images[].input.create.height` **[Number][7]?** * `images[].input.create` **[Object][4]?** describes a blank overlay to be created.
- `images[].input.create.channels` **[Number][7]?** 3-4
- `images[].input.create.background` **([String][6] \| [Object][4])?** parsed by the [color][8] module to extract values for red, green, blue and alpha. * `images[].input.create.width` **[Number][7]?**
- `images[].blend` **[String][6]** how to blend this image with the image below. (optional, default `'over'`) * `images[].input.create.height` **[Number][7]?**
- `images[].gravity` **[String][6]** gravity at which to place the overlay. (optional, default `'centre'`) * `images[].input.create.channels` **[Number][7]?** 3-4
- `images[].top` **[Number][7]?** the pixel offset from the top edge. * `images[].input.create.background` **([String][6] | [Object][4])?** parsed by the [color][8] module to extract values for red, green, blue and alpha.
- `images[].left` **[Number][7]?** the pixel offset from the left edge. * `images[].blend` **[String][6]** how to blend this image with the image below. (optional, default `'over'`)
- `images[].tile` **[Boolean][9]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`) * `images[].gravity` **[String][6]** gravity at which to place the overlay. (optional, default `'centre'`)
- `images[].premultiplied` **[Boolean][9]** set to true to avoid premultipling the image below. Equivalent to the `--premultiplied` vips option. (optional, default `false`) * `images[].top` **[Number][7]?** the pixel offset from the top edge.
- `images[].density` **[Number][7]** number representing the DPI for vector overlay image. (optional, default `72`) * `images[].left` **[Number][7]?** the pixel offset from the left edge.
- `images[].raw` **[Object][4]?** describes overlay when using raw pixel data. * `images[].tile` **[Boolean][9]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`)
- `images[].raw.width` **[Number][7]?** * `images[].premultiplied` **[Boolean][9]** set to true to avoid premultipling the image below. Equivalent to the `--premultiplied` vips option. (optional, default `false`)
- `images[].raw.height` **[Number][7]?** * `images[].density` **[Number][7]** number representing the DPI for vector overlay image. (optional, default `72`)
- `images[].raw.channels` **[Number][7]?** * `images[].raw` **[Object][4]?** describes overlay when using raw pixel data.
* `images[].raw.width` **[Number][7]?**
* `images[].raw.height` **[Number][7]?**
* `images[].raw.channels` **[Number][7]?**
### Examples ### Examples
@ -57,13 +61,13 @@ sharp('input.png')
}); });
``` ```
- Throws **[Error][10]** Invalid parameters * Throws **[Error][10]** Invalid parameters
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.22.0 * **since**: 0.22.0
[1]: https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode [1]: https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode

View File

@ -13,37 +13,41 @@ Implements the [stream.Duplex][1] class.
### Parameters ### Parameters
- `input` **([Buffer][2] \| [Uint8Array][3] \| [Uint8ClampedArray][4] \| [string][5])?** if present, can be * `input` **([Buffer][2] | [Uint8Array][3] | [Uint8ClampedArray][4] | [string][5])?** if present, can be
a Buffer / Uint8Array / Uint8ClampedArray containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or a Buffer / Uint8Array / Uint8ClampedArray containing JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data, or
a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file. a String containing the filesystem path to an JPEG, PNG, WebP, AVIF, GIF, SVG or TIFF image file.
JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present. JPEG, PNG, WebP, AVIF, GIF, SVG, TIFF or raw pixel image data can be streamed into the object when not present.
- `options` **[Object][6]?** if present, is an Object with optional attributes. * `options` **[Object][6]?** if present, is an Object with optional attributes.
- `options.failOnError` **[boolean][7]** by default halt processing and raise an error when loading invalid images.
Set this flag to `false` if you'd rather apply a "best effort" to decode images, even if the data is corrupt or invalid. (optional, default `true`) * `options.failOnError` **[boolean][7]** by default halt processing and raise an error when loading invalid images.
- `options.limitInputPixels` **([number][8] \| [boolean][7])** Do not process input images where the number of pixels Set this flag to `false` if you'd rather apply a "best effort" to decode images, even if the data is corrupt or invalid. (optional, default `true`)
(width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted. * `options.limitInputPixels` **([number][8] | [boolean][7])** Do not process input images where the number of pixels
An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default `268402689`) (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted.
- `options.sequentialRead` **[boolean][7]** Set this to `true` to use sequential rather than random access where possible. An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default `268402689`)
This can reduce memory usage and might improve performance on some systems. (optional, default `false`) * `options.sequentialRead` **[boolean][7]** Set this to `true` to use sequential rather than random access where possible.
- `options.density` **[number][8]** number representing the DPI for vector images in the range 1 to 100000. (optional, default `72`) This can reduce memory usage and might improve performance on some systems. (optional, default `false`)
- `options.pages` **[number][8]** number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1 for all pages. (optional, default `1`) * `options.density` **[number][8]** number representing the DPI for vector images in the range 1 to 100000. (optional, default `72`)
- `options.page` **[number][8]** page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), zero based. (optional, default `0`) * `options.pages` **[number][8]** number of pages to extract for multi-page input (GIF, WebP, AVIF, TIFF, PDF), use -1 for all pages. (optional, default `1`)
- `options.subifd` **[number][8]** subIFD (Sub Image File Directory) to extract for OME-TIFF, defaults to main image. (optional, default `-1`) * `options.page` **[number][8]** page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), zero based. (optional, default `0`)
- `options.level` **[number][8]** level to extract from a multi-level input (OpenSlide), zero based. (optional, default `0`) * `options.subifd` **[number][8]** subIFD (Sub Image File Directory) to extract for OME-TIFF, defaults to main image. (optional, default `-1`)
- `options.animated` **[boolean][7]** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default `false`) * `options.level` **[number][8]** level to extract from a multi-level input (OpenSlide), zero based. (optional, default `0`)
- `options.raw` **[Object][6]?** describes raw pixel input image data. See `raw()` for pixel ordering. * `options.animated` **[boolean][7]** Set to `true` to read all frames/pages of an animated image (equivalent of setting `pages` to `-1`). (optional, default `false`)
- `options.raw.width` **[number][8]?** integral number of pixels wide. * `options.raw` **[Object][6]?** describes raw pixel input image data. See `raw()` for pixel ordering.
- `options.raw.height` **[number][8]?** integral number of pixels high.
- `options.raw.channels` **[number][8]?** integral number of channels, between 1 and 4. * `options.raw.width` **[number][8]?** integral number of pixels wide.
- `options.create` **[Object][6]?** describes a new image to be created. * `options.raw.height` **[number][8]?** integral number of pixels high.
- `options.create.width` **[number][8]?** integral number of pixels wide. * `options.raw.channels` **[number][8]?** integral number of channels, between 1 and 4.
- `options.create.height` **[number][8]?** integral number of pixels high. * `options.create` **[Object][6]?** describes a new image to be created.
- `options.create.channels` **[number][8]?** integral number of channels, either 3 (RGB) or 4 (RGBA).
- `options.create.background` **([string][5] \| [Object][6])?** parsed by the [color][9] module to extract values for red, green, blue and alpha. * `options.create.width` **[number][8]?** integral number of pixels wide.
- `options.create.noise` **[Object][6]?** describes a noise to be created. * `options.create.height` **[number][8]?** integral number of pixels high.
- `options.create.noise.type` **[string][5]?** type of generated noise, currently only `gaussian` is supported. * `options.create.channels` **[number][8]?** integral number of channels, either 3 (RGB) or 4 (RGBA).
- `options.create.noise.mean` **[number][8]?** mean of pixels in generated noise. * `options.create.background` **([string][5] | [Object][6])?** parsed by the [color][9] module to extract values for red, green, blue and alpha.
- `options.create.noise.sigma` **[number][8]?** standard deviation of pixels in generated noise. * `options.create.noise` **[Object][6]?** describes a noise to be created.
* `options.create.noise.type` **[string][5]?** type of generated noise, currently only `gaussian` is supported.
* `options.create.noise.mean` **[number][8]?** mean of pixels in generated noise.
* `options.create.noise.sigma` **[number][8]?** standard deviation of pixels in generated noise.
### Examples ### Examples
@ -120,7 +124,7 @@ await sharp({
}).toFile('noise.png'); }).toFile('noise.png');
``` ```
- Throws **[Error][10]** Invalid parameters * Throws **[Error][10]** Invalid parameters
Returns **[Sharp][11]** Returns **[Sharp][11]**

View File

@ -5,35 +5,35 @@
Fast access to (uncached) image metadata without decoding any compressed image data. Fast access to (uncached) image metadata without decoding any compressed image data.
A `Promise` is returned when `callback` is not provided. A `Promise` is returned when `callback` is not provided.
- `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg` * `format`: Name of decoder used to decompress image data e.g. `jpeg`, `png`, `webp`, `gif`, `svg`
- `size`: Total size of image in bytes, for Stream and Buffer input only * `size`: Total size of image in bytes, for Stream and Buffer input only
- `width`: Number of pixels wide (EXIF orientation is not taken into consideration) * `width`: Number of pixels wide (EXIF orientation is not taken into consideration)
- `height`: Number of pixels high (EXIF orientation is not taken into consideration) * `height`: Number of pixels high (EXIF orientation is not taken into consideration)
- `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][1] * `space`: Name of colour space interpretation e.g. `srgb`, `rgb`, `cmyk`, `lab`, `b-w` [...][1]
- `channels`: Number of bands e.g. `3` for sRGB, `4` for CMYK * `channels`: Number of bands e.g. `3` for sRGB, `4` for CMYK
- `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...][2] * `depth`: Name of pixel depth format e.g. `uchar`, `char`, `ushort`, `float` [...][2]
- `density`: Number of pixels per inch (DPI), if present * `density`: Number of pixels per inch (DPI), if present
- `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK * `chromaSubsampling`: String containing JPEG chroma subsampling, `4:2:0` or `4:4:4` for RGB, `4:2:0:4` or `4:4:4:4` for CMYK
- `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan * `isProgressive`: Boolean indicating whether the image is interlaced using a progressive scan
- `pages`: Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP * `pages`: Number of pages/frames contained within the image, with support for TIFF, HEIF, PDF, animated GIF and animated WebP
- `pageHeight`: Number of pixels high each page in a multi-page image will be. * `pageHeight`: Number of pixels high each page in a multi-page image will be.
- `loop`: Number of times to loop an animated image, zero refers to a continuous loop. * `loop`: Number of times to loop an animated image, zero refers to a continuous loop.
- `delay`: Delay in ms between each page in an animated image, provided as an array of integers. * `delay`: Delay in ms between each page in an animated image, provided as an array of integers.
- `pagePrimary`: Number of the primary page in a HEIF image * `pagePrimary`: Number of the primary page in a HEIF image
- `levels`: Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide * `levels`: Details of each level in a multi-level image provided as an array of objects, requires libvips compiled with support for OpenSlide
- `subifds`: Number of Sub Image File Directories in an OME-TIFF image * `subifds`: Number of Sub Image File Directories in an OME-TIFF image
- `hasProfile`: Boolean indicating the presence of an embedded ICC profile * `hasProfile`: Boolean indicating the presence of an embedded ICC profile
- `hasAlpha`: Boolean indicating the presence of an alpha transparency channel * `hasAlpha`: Boolean indicating the presence of an alpha transparency channel
- `orientation`: Number value of the EXIF Orientation header, if present * `orientation`: Number value of the EXIF Orientation header, if present
- `exif`: Buffer containing raw EXIF data, if present * `exif`: Buffer containing raw EXIF data, if present
- `icc`: Buffer containing raw [ICC][3] profile data, if present * `icc`: Buffer containing raw [ICC][3] profile data, if present
- `iptc`: Buffer containing raw IPTC data, if present * `iptc`: Buffer containing raw IPTC data, if present
- `xmp`: Buffer containing raw XMP data, if present * `xmp`: Buffer containing raw XMP data, if present
- `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present * `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present
### Parameters ### Parameters
- `callback` **[Function][4]?** called with the arguments `(err, metadata)` * `callback` **[Function][4]?** called with the arguments `(err, metadata)`
### Examples ### Examples
@ -52,32 +52,32 @@ image
}); });
``` ```
Returns **([Promise][5]&lt;[Object][6]> | Sharp)** Returns **([Promise][5]<[Object][6]> | Sharp)**
## stats ## stats
Access to pixel-derived image statistics for every channel in the image. Access to pixel-derived image statistics for every channel in the image.
A `Promise` is returned when `callback` is not provided. A `Promise` is returned when `callback` is not provided.
- `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains * `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains
- `min` (minimum value in the channel) * `min` (minimum value in the channel)
- `max` (maximum value in the channel) * `max` (maximum value in the channel)
- `sum` (sum of all values in a channel) * `sum` (sum of all values in a channel)
- `squaresSum` (sum of squared values in a channel) * `squaresSum` (sum of squared values in a channel)
- `mean` (mean of the values in a channel) * `mean` (mean of the values in a channel)
- `stdev` (standard deviation for the values in a channel) * `stdev` (standard deviation for the values in a channel)
- `minX` (x-coordinate of one of the pixel where the minimum lies) * `minX` (x-coordinate of one of the pixel where the minimum lies)
- `minY` (y-coordinate of one of the pixel where the minimum lies) * `minY` (y-coordinate of one of the pixel where the minimum lies)
- `maxX` (x-coordinate of one of the pixel where the maximum lies) * `maxX` (x-coordinate of one of the pixel where the maximum lies)
- `maxY` (y-coordinate of one of the pixel where the maximum lies) * `maxY` (y-coordinate of one of the pixel where the maximum lies)
- `isOpaque`: Is the image fully opaque? Will be `true` if the image has no alpha channel or if every pixel is fully opaque. * `isOpaque`: Is the image fully opaque? Will be `true` if the image has no alpha channel or if every pixel is fully opaque.
- `entropy`: Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental) * `entropy`: Histogram-based estimation of greyscale entropy, discarding alpha channel if any (experimental)
- `sharpness`: Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any (experimental) * `sharpness`: Estimation of greyscale sharpness based on the standard deviation of a Laplacian convolution, discarding alpha channel if any (experimental)
- `dominant`: Object containing most dominant sRGB colour based on a 4096-bin 3D histogram (experimental) * `dominant`: Object containing most dominant sRGB colour based on a 4096-bin 3D histogram (experimental)
### Parameters ### Parameters
- `callback` **[Function][4]?** called with the arguments `(err, stats)` * `callback` **[Function][4]?** called with the arguments `(err, stats)`
### Examples ### Examples
@ -95,7 +95,7 @@ const { entropy, sharpness, dominant } = await sharp(input).stats();
const { r, g, b } = dominant; const { r, g, b } = dominant;
``` ```
Returns **[Promise][5]&lt;[Object][6]>** Returns **[Promise][5]<[Object][6]>**
[1]: https://libvips.github.io/libvips/API/current/VipsImage.html#VipsInterpretation [1]: https://libvips.github.io/libvips/API/current/VipsImage.html#VipsInterpretation

View File

@ -21,9 +21,10 @@ for example `rotate(x).extract(y)` will produce a different result to `extract(y
### Parameters ### Parameters
- `angle` **[number][1]** angle of rotation. (optional, default `auto`) * `angle` **[number][1]** angle of rotation. (optional, default `auto`)
- `options` **[Object][2]?** if present, is an Object with optional attributes. * `options` **[Object][2]?** if present, is an Object with optional attributes.
- `options.background` **([string][3] \| [Object][2])** parsed by the [color][4] module to extract values for red, green, blue and alpha. (optional, default `"#000000"`)
* `options.background` **([string][3] | [Object][2])** parsed by the [color][4] module to extract values for red, green, blue and alpha. (optional, default `"#000000"`)
### Examples ### Examples
@ -39,7 +40,7 @@ const pipeline = sharp()
readableStream.pipe(pipeline); readableStream.pipe(pipeline);
``` ```
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -50,7 +51,7 @@ The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
### Parameters ### Parameters
- `flip` **[Boolean][6]** (optional, default `true`) * `flip` **[Boolean][6]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -61,7 +62,7 @@ The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
### Parameters ### Parameters
- `flop` **[Boolean][6]** (optional, default `true`) * `flop` **[Boolean][6]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -75,25 +76,26 @@ A particular interpolator may also be specified. Set the `interpolator` option t
In the case of a 2x2 matrix, the transform is: In the case of a 2x2 matrix, the transform is:
- X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` * X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx`
- Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody` * Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody`
where: where:
- x and y are the coordinates in input image. * x and y are the coordinates in input image.
- X and Y are the coordinates in output image. * X and Y are the coordinates in output image.
- (0,0) is the upper left corner. * (0,0) is the upper left corner.
### Parameters ### Parameters
- `matrix` **([Array][7]&lt;[Array][7]&lt;[number][1]>> | [Array][7]&lt;[number][1]>)** affine transformation matrix * `matrix` **([Array][7]<[Array][7]<[number][1]>> | [Array][7]<[number][1]>)** affine transformation matrix
- `options` **[Object][2]?** if present, is an Object with optional attributes. * `options` **[Object][2]?** if present, is an Object with optional attributes.
- `options.background` **([String][3] \| [Object][2])** parsed by the [color][4] module to extract values for red, green, blue and alpha. (optional, default `"#000000"`)
- `options.idx` **[Number][1]** input horizontal offset (optional, default `0`) * `options.background` **([String][3] | [Object][2])** parsed by the [color][4] module to extract values for red, green, blue and alpha. (optional, default `"#000000"`)
- `options.idy` **[Number][1]** input vertical offset (optional, default `0`) * `options.idx` **[Number][1]** input horizontal offset (optional, default `0`)
- `options.odx` **[Number][1]** output horizontal offset (optional, default `0`) * `options.idy` **[Number][1]** input vertical offset (optional, default `0`)
- `options.ody` **[Number][1]** output vertical offset (optional, default `0`) * `options.odx` **[Number][1]** output horizontal offset (optional, default `0`)
- `options.interpolator` **[String][3]** interpolator (optional, default `sharp.interpolators.bicubic`) * `options.ody` **[Number][1]** output vertical offset (optional, default `0`)
* `options.interpolator` **[String][3]** interpolator (optional, default `sharp.interpolators.bicubic`)
### Examples ### Examples
@ -112,13 +114,13 @@ inputStream
.pipe(pipeline); .pipe(pipeline);
``` ```
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.27.0 * **since**: 0.27.0
## sharpen ## sharpen
@ -129,12 +131,13 @@ Separate control over the level of sharpening in "flat" and "jagged" areas is av
### Parameters ### Parameters
- `sigma` **[number][1]?** the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`. * `sigma` **[number][1]?** the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
- `flat` **[number][1]** the level of sharpening to apply to "flat" areas. (optional, default `1.0`) * `flat` **[number][1]** the level of sharpening to apply to "flat" areas. (optional, default `1.0`)
- `jagged` **[number][1]** the level of sharpening to apply to "jagged" areas. (optional, default `2.0`) * `jagged` **[number][1]** the level of sharpening to apply to "jagged" areas. (optional, default `2.0`)
<!---->
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -145,10 +148,11 @@ When used without parameters the default window is 3x3.
### Parameters ### Parameters
- `size` **[number][1]** square mask size: size x size (optional, default `3`) * `size` **[number][1]** square mask size: size x size (optional, default `3`)
<!---->
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -160,10 +164,11 @@ When a `sigma` is provided, performs a slower, more accurate Gaussian blur.
### Parameters ### Parameters
- `sigma` **[number][1]?** a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`. * `sigma` **[number][1]?** a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
<!---->
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -173,8 +178,9 @@ Merge alpha transparency channel, if any, with a background, then remove the alp
### Parameters ### Parameters
- `options` **[Object][2]?** * `options` **[Object][2]?**
- `options.background` **([string][3] \| [Object][2])** background colour, parsed by the [color][4] module, defaults to black. (optional, default `{r:0,g:0,b:0}`)
* `options.background` **([string][3] | [Object][2])** background colour, parsed by the [color][4] module, defaults to black. (optional, default `{r:0,g:0,b:0}`)
### Examples ### Examples
@ -198,11 +204,12 @@ Supply a second argument to use a different output gamma value, otherwise the fi
### Parameters ### Parameters
- `gamma` **[number][1]** value between 1.0 and 3.0. (optional, default `2.2`) * `gamma` **[number][1]** value between 1.0 and 3.0. (optional, default `2.2`)
- `gammaOut` **[number][1]?** value between 1.0 and 3.0. (optional, defaults to same as `gamma`) * `gammaOut` **[number][1]?** value between 1.0 and 3.0. (optional, defaults to same as `gamma`)
<!---->
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -212,7 +219,7 @@ Produce the "negative" of the image.
### Parameters ### Parameters
- `negate` **[Boolean][6]** (optional, default `true`) * `negate` **[Boolean][6]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -222,7 +229,7 @@ Enhance output image contrast by stretching its luminance to cover the full dyna
### Parameters ### Parameters
- `normalise` **[Boolean][6]** (optional, default `true`) * `normalise` **[Boolean][6]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -232,7 +239,7 @@ Alternative spelling of normalise.
### Parameters ### Parameters
- `normalize` **[Boolean][6]** (optional, default `true`) * `normalize` **[Boolean][6]** (optional, default `true`)
Returns **Sharp** Returns **Sharp**
@ -242,12 +249,13 @@ Convolve the image with the specified kernel.
### Parameters ### Parameters
- `kernel` **[Object][2]** * `kernel` **[Object][2]**
- `kernel.width` **[number][1]** width of the kernel in pixels.
- `kernel.height` **[number][1]** width of the kernel in pixels. * `kernel.width` **[number][1]** width of the kernel in pixels.
- `kernel.kernel` **[Array][7]&lt;[number][1]>** Array of length `width*height` containing the kernel values. * `kernel.height` **[number][1]** width of the kernel in pixels.
- `kernel.scale` **[number][1]** the scale of the kernel in pixels. (optional, default `sum`) * `kernel.kernel` **[Array][7]<[number][1]>** Array of length `width*height` containing the kernel values.
- `kernel.offset` **[number][1]** the offset of the kernel in pixels. (optional, default `0`) * `kernel.scale` **[number][1]** the scale of the kernel in pixels. (optional, default `sum`)
* `kernel.offset` **[number][1]** the offset of the kernel in pixels. (optional, default `0`)
### Examples ### Examples
@ -265,7 +273,7 @@ sharp(input)
}); });
``` ```
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -275,13 +283,15 @@ Any pixel value greater than or equal to the threshold value will be set to 255,
### Parameters ### Parameters
- `threshold` **[number][1]** a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default `128`) * `threshold` **[number][1]** a value in the range 0-255 representing the level at which the threshold will be applied. (optional, default `128`)
- `options` **[Object][2]?** * `options` **[Object][2]?**
- `options.greyscale` **[Boolean][6]** convert to single channel greyscale. (optional, default `true`)
- `options.grayscale` **[Boolean][6]** alternative spelling for greyscale. (optional, default `true`)
* `options.greyscale` **[Boolean][6]** convert to single channel greyscale. (optional, default `true`)
* `options.grayscale` **[Boolean][6]** alternative spelling for greyscale. (optional, default `true`)
- Throws **[Error][5]** Invalid parameters <!---->
* Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -294,16 +304,19 @@ the selected bitwise boolean `operation` between the corresponding pixels of the
### Parameters ### Parameters
- `operand` **([Buffer][8] \| [string][3])** Buffer containing image data or string containing the path to an image file. * `operand` **([Buffer][8] | [string][3])** Buffer containing image data or string containing the path to an image file.
- `operator` **[string][3]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively. * `operator` **[string][3]** one of `and`, `or` or `eor` to perform that bitwise operation, like the C logic operators `&`, `|` and `^` respectively.
- `options` **[Object][2]?** * `options` **[Object][2]?**
- `options.raw` **[Object][2]?** describes operand when using raw pixel data.
- `options.raw.width` **[number][1]?**
- `options.raw.height` **[number][1]?**
- `options.raw.channels` **[number][1]?**
* `options.raw` **[Object][2]?** describes operand when using raw pixel data.
- Throws **[Error][5]** Invalid parameters * `options.raw.width` **[number][1]?**
* `options.raw.height` **[number][1]?**
* `options.raw.channels` **[number][1]?**
<!---->
* Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -313,11 +326,12 @@ Apply the linear formula a \* input + b to the image (levels adjustment)
### Parameters ### Parameters
- `a` **[number][1]** multiplier (optional, default `1.0`) * `a` **[number][1]** multiplier (optional, default `1.0`)
- `b` **[number][1]** offset (optional, default `0.0`) * `b` **[number][1]** offset (optional, default `0.0`)
<!---->
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -327,7 +341,7 @@ Recomb the image with the specified matrix.
### Parameters ### Parameters
- `inputMatrix` **[Array][7]&lt;[Array][7]&lt;[number][1]>>** 3x3 Recombination matrix * `inputMatrix` **[Array][7]<[Array][7]<[number][1]>>** 3x3 Recombination matrix
### Examples ### Examples
@ -345,13 +359,13 @@ sharp(input)
}); });
``` ```
- Throws **[Error][5]** Invalid parameters * Throws **[Error][5]** Invalid parameters
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.21.1 * **since**: 0.21.1
## modulate ## modulate
@ -359,10 +373,11 @@ Transforms the image using brightness, saturation and hue rotation.
### Parameters ### Parameters
- `options` **[Object][2]?** * `options` **[Object][2]?**
- `options.brightness` **[number][1]?** Brightness multiplier
- `options.saturation` **[number][1]?** Saturation multiplier * `options.brightness` **[number][1]?** Brightness multiplier
- `options.hue` **[number][1]?** Degrees for hue rotation * `options.saturation` **[number][1]?** Saturation multiplier
* `options.hue` **[number][1]?** Degrees for hue rotation
### Examples ### Examples
@ -390,7 +405,7 @@ Returns **Sharp**
**Meta** **Meta**
- **since**: 0.22.1 * **since**: 0.22.1
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

View File

@ -15,8 +15,8 @@ A `Promise` is returned when `callback` is not provided.
### Parameters ### Parameters
- `fileOut` **[string][2]** the path to write the image data to. * `fileOut` **[string][2]** the path to write the image data to.
- `callback` **[Function][3]?** called on completion with two arguments `(err, info)`. * `callback` **[Function][3]?** called on completion with two arguments `(err, info)`.
`info` contains the output image `format`, `size` (bytes), `width`, `height`, `info` contains the output image `format`, `size` (bytes), `width`, `height`,
`channels` and `premultiplied` (indicating if premultiplication was used). `channels` and `premultiplied` (indicating if premultiplication was used).
When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`.
@ -35,9 +35,9 @@ sharp(input)
.catch(err => { ... }); .catch(err => { ... });
``` ```
- Throws **[Error][4]** Invalid parameters * Throws **[Error][4]** Invalid parameters
Returns **[Promise][5]&lt;[Object][6]>** when no callback is provided Returns **[Promise][5]<[Object][6]>** when no callback is provided
## toBuffer ## toBuffer
@ -51,19 +51,21 @@ See [withMetadata][1] for control over this.
`callback`, if present, gets three arguments `(err, data, info)` where: `callback`, if present, gets three arguments `(err, data, info)` where:
- `err` is an error, if any. * `err` is an error, if any.
- `data` is the output image data. * `data` is the output image data.
- `info` contains the output image `format`, `size` (bytes), `width`, `height`, * `info` contains the output image `format`, `size` (bytes), `width`, `height`,
`channels` and `premultiplied` (indicating if premultiplication was used).
When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`. `channels` and `premultiplied` (indicating if premultiplication was used).
When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`.
A `Promise` is returned when `callback` is not provided. A `Promise` is returned when `callback` is not provided.
### Parameters ### Parameters
- `options` **[Object][6]?** * `options` **[Object][6]?**
- `options.resolveWithObject` **[boolean][7]?** Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`.
- `callback` **[Function][3]?** * `options.resolveWithObject` **[boolean][7]?** Resolve the Promise with an Object containing `data` and `info` properties instead of resolving only with `data`.
* `callback` **[Function][3]?**
### Examples ### Examples
@ -103,7 +105,7 @@ await sharp(pixelArray, { raw: { width, height, channels } })
.toFile('my-changed-image.jpg'); .toFile('my-changed-image.jpg');
``` ```
Returns **[Promise][5]&lt;[Buffer][8]>** when no callback is provided Returns **[Promise][5]<[Buffer][8]>** when no callback is provided
## withMetadata ## withMetadata
@ -116,11 +118,12 @@ sRGB colour space and strip all metadata, including the removal of any ICC profi
### Parameters ### Parameters
- `options` **[Object][6]?** * `options` **[Object][6]?**
- `options.orientation` **[number][9]?** value between 1 and 8, used to update the EXIF `Orientation` tag.
- `options.icc` **[string][2]?** filesystem path to output ICC profile, defaults to sRGB. * `options.orientation` **[number][9]?** value between 1 and 8, used to update the EXIF `Orientation` tag.
- `options.exif` **[Object][6]&lt;[Object][6]>** Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. (optional, default `{}`) * `options.icc` **[string][2]?** filesystem path to output ICC profile, defaults to sRGB.
- `options.density` **[number][9]?** Number of pixels per inch (DPI). * `options.exif` **[Object][6]<[Object][6]>** Object keyed by IFD0, IFD1 etc. of key/value string pairs to write as EXIF data. (optional, default `{}`)
* `options.density` **[number][9]?** Number of pixels per inch (DPI).
### Examples ### Examples
@ -150,7 +153,7 @@ const data = await sharp(input)
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][4]** Invalid parameters * Throws **[Error][4]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -160,8 +163,8 @@ Force output to a given format.
### Parameters ### Parameters
- `format` **([string][2] \| [Object][6])** as a string or an Object with an 'id' attribute * `format` **([string][2] | [Object][6])** as a string or an Object with an 'id' attribute
- `options` **[Object][6]** output options * `options` **[Object][6]** output options
### Examples ### Examples
@ -172,7 +175,7 @@ const data = await sharp(input)
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][4]** unsupported format or options * Throws **[Error][4]** unsupported format or options
Returns **Sharp** Returns **Sharp**
@ -182,20 +185,21 @@ Use these JPEG options for output image.
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.progressive` **[boolean][7]** use progressive (interlace) scan (optional, default `false`) * `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling (optional, default `'4:2:0'`) * `options.progressive` **[boolean][7]** use progressive (interlace) scan (optional, default `false`)
- `options.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`) * `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling (optional, default `'4:2:0'`)
- `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`) * `options.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`)
- `options.mozjpeg` **[boolean][7]** use mozjpeg defaults, equivalent to `{ trellisQuantisation: true, overshootDeringing: true, optimiseScans: true, quantisationTable: 3 }` (optional, default `false`) * `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`)
- `options.trellisQuantisation` **[boolean][7]** apply trellis quantisation (optional, default `false`) * `options.mozjpeg` **[boolean][7]** use mozjpeg defaults, equivalent to `{ trellisQuantisation: true, overshootDeringing: true, optimiseScans: true, quantisationTable: 3 }` (optional, default `false`)
- `options.overshootDeringing` **[boolean][7]** apply overshoot deringing (optional, default `false`) * `options.trellisQuantisation` **[boolean][7]** apply trellis quantisation (optional, default `false`)
- `options.optimiseScans` **[boolean][7]** optimise progressive scans, forces progressive (optional, default `false`) * `options.overshootDeringing` **[boolean][7]** apply overshoot deringing (optional, default `false`)
- `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans (optional, default `false`) * `options.optimiseScans` **[boolean][7]** optimise progressive scans, forces progressive (optional, default `false`)
- `options.quantisationTable` **[number][9]** quantization table to use, integer 0-8 (optional, default `0`) * `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans (optional, default `false`)
- `options.quantizationTable` **[number][9]** alternative spelling of quantisationTable (optional, default `0`) * `options.quantisationTable` **[number][9]** quantization table to use, integer 0-8 (optional, default `0`)
- `options.force` **[boolean][7]** force JPEG output, otherwise attempt to use input format (optional, default `true`) * `options.quantizationTable` **[number][9]** alternative spelling of quantisationTable (optional, default `0`)
* `options.force` **[boolean][7]** force JPEG output, otherwise attempt to use input format (optional, default `true`)
### Examples ### Examples
@ -216,7 +220,7 @@ const data = await sharp(input)
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][4]** Invalid options * Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
@ -230,16 +234,17 @@ Set `palette` to `true` for slower, indexed PNG output.
### Parameters ### Parameters
- `options` **[Object][6]?** * `options` **[Object][6]?**
- `options.progressive` **[boolean][7]** use progressive (interlace) scan (optional, default `false`)
- `options.compressionLevel` **[number][9]** zlib compression level, 0 (fastest, largest) to 9 (slowest, smallest) (optional, default `6`) * `options.progressive` **[boolean][7]** use progressive (interlace) scan (optional, default `false`)
- `options.adaptiveFiltering` **[boolean][7]** use adaptive row filtering (optional, default `false`) * `options.compressionLevel` **[number][9]** zlib compression level, 0 (fastest, largest) to 9 (slowest, smallest) (optional, default `6`)
- `options.palette` **[boolean][7]** quantise to a palette-based image with alpha transparency support (optional, default `false`) * `options.adaptiveFiltering` **[boolean][7]** use adaptive row filtering (optional, default `false`)
- `options.quality` **[number][9]** use the lowest number of colours needed to achieve given quality, sets `palette` to `true` (optional, default `100`) * `options.palette` **[boolean][7]** quantise to a palette-based image with alpha transparency support (optional, default `false`)
- `options.colours` **[number][9]** maximum number of palette entries, sets `palette` to `true` (optional, default `256`) * `options.quality` **[number][9]** use the lowest number of colours needed to achieve given quality, sets `palette` to `true` (optional, default `100`)
- `options.colors` **[number][9]** alternative spelling of `options.colours`, sets `palette` to `true` (optional, default `256`) * `options.colours` **[number][9]** maximum number of palette entries, sets `palette` to `true` (optional, default `256`)
- `options.dither` **[number][9]** level of Floyd-Steinberg error diffusion, sets `palette` to `true` (optional, default `1.0`) * `options.colors` **[number][9]** alternative spelling of `options.colours`, sets `palette` to `true` (optional, default `256`)
- `options.force` **[boolean][7]** force PNG output, otherwise attempt to use input format (optional, default `true`) * `options.dither` **[number][9]** level of Floyd-Steinberg error diffusion, sets `palette` to `true` (optional, default `1.0`)
* `options.force` **[boolean][7]** force PNG output, otherwise attempt to use input format (optional, default `true`)
### Examples ### Examples
@ -257,7 +262,7 @@ const data = await sharp(input)
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][4]** Invalid options * Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
@ -267,17 +272,18 @@ Use these WebP options for output image.
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.alphaQuality` **[number][9]** quality of alpha layer, integer 0-100 (optional, default `100`) * `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.lossless` **[boolean][7]** use lossless compression mode (optional, default `false`) * `options.alphaQuality` **[number][9]** quality of alpha layer, integer 0-100 (optional, default `100`)
- `options.nearLossless` **[boolean][7]** use near_lossless compression mode (optional, default `false`) * `options.lossless` **[boolean][7]** use lossless compression mode (optional, default `false`)
- `options.smartSubsample` **[boolean][7]** use high quality chroma subsampling (optional, default `false`) * `options.nearLossless` **[boolean][7]** use near_lossless compression mode (optional, default `false`)
- `options.reductionEffort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (optional, default `4`) * `options.smartSubsample` **[boolean][7]** use high quality chroma subsampling (optional, default `false`)
- `options.pageHeight` **[number][9]?** page height for animated output * `options.reductionEffort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (optional, default `4`)
- `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`) * `options.pageHeight` **[number][9]?** page height for animated output
- `options.delay` **[Array][10]&lt;[number][9]>?** list of delays between animation frames (in milliseconds) * `options.loop` **[number][9]** number of animation iterations, use 0 for infinite animation (optional, default `0`)
- `options.force` **[boolean][7]** force WebP output, otherwise attempt to use input format (optional, default `true`) * `options.delay` **[Array][10]<[number][9]>?** list of delays between animation frames (in milliseconds)
* `options.force` **[boolean][7]** force WebP output, otherwise attempt to use input format (optional, default `true`)
### Examples ### Examples
@ -295,7 +301,7 @@ const outputWebp = await sharp(inputWebp, { animated: true })
.toBuffer(); .toBuffer();
``` ```
- Throws **[Error][4]** Invalid options * Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
@ -309,14 +315,16 @@ The prebuilt binaries do not include this - see
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `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.delay` **[Array][10]&lt;[number][9]>?** list of delays between animation frames (in milliseconds)
- `options.force` **[boolean][7]** force GIF output, otherwise attempt to use input format (optional, default `true`)
* `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.delay` **[Array][10]<[number][9]>?** list of delays between animation frames (in milliseconds)
* `options.force` **[boolean][7]** force GIF output, otherwise attempt to use input format (optional, default `true`)
- Throws **[Error][4]** Invalid options <!---->
* Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
@ -326,18 +334,19 @@ Use these TIFF options for output image.
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.force` **[boolean][7]** force TIFF output, otherwise attempt to use input format (optional, default `true`) * `options.quality` **[number][9]** quality, integer 1-100 (optional, default `80`)
- `options.compression` **[string][2]** compression options: lzw, deflate, jpeg, ccittfax4 (optional, default `'jpeg'`) * `options.force` **[boolean][7]** force TIFF output, otherwise attempt to use input format (optional, default `true`)
- `options.predictor` **[string][2]** compression predictor options: none, horizontal, float (optional, default `'horizontal'`) * `options.compression` **[string][2]** compression options: lzw, deflate, jpeg, ccittfax4 (optional, default `'jpeg'`)
- `options.pyramid` **[boolean][7]** write an image pyramid (optional, default `false`) * `options.predictor` **[string][2]** compression predictor options: none, horizontal, float (optional, default `'horizontal'`)
- `options.tile` **[boolean][7]** write a tiled tiff (optional, default `false`) * `options.pyramid` **[boolean][7]** write an image pyramid (optional, default `false`)
- `options.tileWidth` **[number][9]** horizontal tile size (optional, default `256`) * `options.tile` **[boolean][7]** write a tiled tiff (optional, default `false`)
- `options.tileHeight` **[number][9]** vertical tile size (optional, default `256`) * `options.tileWidth` **[number][9]** horizontal tile size (optional, default `256`)
- `options.xres` **[number][9]** horizontal resolution in pixels/mm (optional, default `1.0`) * `options.tileHeight` **[number][9]** vertical tile size (optional, default `256`)
- `options.yres` **[number][9]** vertical resolution in pixels/mm (optional, default `1.0`) * `options.xres` **[number][9]** horizontal resolution in pixels/mm (optional, default `1.0`)
- `options.bitdepth` **[number][9]** reduce bitdepth to 1, 2 or 4 bit (optional, default `8`) * `options.yres` **[number][9]** vertical resolution in pixels/mm (optional, default `1.0`)
* `options.bitdepth` **[number][9]** reduce bitdepth to 1, 2 or 4 bit (optional, default `8`)
### Examples ### Examples
@ -352,7 +361,7 @@ sharp('input.svg')
.then(info => { ... }); .then(info => { ... });
``` ```
- Throws **[Error][4]** Invalid options * Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
@ -365,20 +374,22 @@ most web browsers do not display these properly.
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
- `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
- `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
- `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling, requires libvips v8.11.0 (optional, default `'4:2:0'`)
* `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
* `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
* `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling, requires libvips v8.11.0 (optional, default `'4:2:0'`)
- Throws **[Error][4]** Invalid options <!---->
* Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.27.0 * **since**: 0.27.0
## heif ## heif
@ -389,21 +400,23 @@ globally-installed libvips compiled with support for libheif, libde265 and x265.
### Parameters ### Parameters
- `options` **[Object][6]?** output options * `options` **[Object][6]?** output options
- `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
- `options.compression` **[string][2]** compression format: av1, hevc (optional, default `'av1'`)
- `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
- `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
- `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling, requires libvips v8.11.0 (optional, default `'4:2:0'`)
* `options.quality` **[number][9]** quality, integer 1-100 (optional, default `50`)
* `options.compression` **[string][2]** compression format: av1, hevc (optional, default `'av1'`)
* `options.lossless` **[boolean][7]** use lossless compression (optional, default `false`)
* `options.speed` **[number][9]** CPU effort vs file size, 0 (slowest/smallest) to 8 (fastest/largest) (optional, default `5`)
* `options.chromaSubsampling` **[string][2]** set to '4:4:4' to prevent chroma subsampling otherwise defaults to '4:2:0' chroma subsampling, requires libvips v8.11.0 (optional, default `'4:2:0'`)
- Throws **[Error][4]** Invalid options <!---->
* Throws **[Error][4]** Invalid options
Returns **Sharp** Returns **Sharp**
**Meta** **Meta**
- **since**: 0.23.0 * **since**: 0.23.0
## raw ## raw
@ -442,18 +455,19 @@ Warning: multiple sharp instances concurrently producing tile output can expose
### Parameters ### Parameters
- `options` **[Object][6]?** * `options` **[Object][6]?**
- `options.size` **[number][9]** tile size in pixels, a value between 1 and 8192. (optional, default `256`)
- `options.overlap` **[number][9]** tile overlap in pixels, a value between 0 and 8192. (optional, default `0`) * `options.size` **[number][9]** tile size in pixels, a value between 1 and 8192. (optional, default `256`)
- `options.angle` **[number][9]** tile angle of rotation, must be a multiple of 90. (optional, default `0`) * `options.overlap` **[number][9]** tile overlap in pixels, a value between 0 and 8192. (optional, default `0`)
- `options.background` **([string][2] \| [Object][6])** background colour, parsed by the [color][12] module, defaults to white without transparency. (optional, default `{r:255,g:255,b:255,alpha:1}`) * `options.angle` **[number][9]** tile angle of rotation, must be a multiple of 90. (optional, default `0`)
- `options.depth` **[string][2]?** how deep to make the pyramid, possible values are `onepixel`, `onetile` or `one`, default based on layout. * `options.background` **([string][2] | [Object][6])** background colour, parsed by the [color][12] module, defaults to white without transparency. (optional, default `{r:255,g:255,b:255,alpha:1}`)
- `options.skipBlanks` **[number][9]** threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images (optional, default `-1`) * `options.depth` **[string][2]?** how deep to make the pyramid, possible values are `onepixel`, `onetile` or `one`, default based on layout.
- `options.container` **[string][2]** tile container, with value `fs` (filesystem) or `zip` (compressed file). (optional, default `'fs'`) * `options.skipBlanks` **[number][9]** threshold to skip tile generation, a value 0 - 255 for 8-bit images or 0 - 65535 for 16-bit images (optional, default `-1`)
- `options.layout` **[string][2]** filesystem layout, possible values are `dz`, `iiif`, `zoomify` or `google`. (optional, default `'dz'`) * `options.container` **[string][2]** tile container, with value `fs` (filesystem) or `zip` (compressed file). (optional, default `'fs'`)
- `options.centre` **[boolean][7]** centre image in tile. (optional, default `false`) * `options.layout` **[string][2]** filesystem layout, possible values are `dz`, `iiif`, `zoomify` or `google`. (optional, default `'dz'`)
- `options.center` **[boolean][7]** alternative spelling of centre. (optional, default `false`) * `options.centre` **[boolean][7]** centre image in tile. (optional, default `false`)
- `options.id` **[string][2]** when `layout` is `iiif`, sets the `@id` attribute of `info.json` (optional, default `'https://example.com/iiif'`) * `options.center` **[boolean][7]** alternative spelling of centre. (optional, default `false`)
* `options.id` **[string][2]** when `layout` is `iiif`, sets the `@id` attribute of `info.json` (optional, default `'https://example.com/iiif'`)
### Examples ### Examples
@ -469,7 +483,7 @@ sharp('input.tiff')
}); });
``` ```
- Throws **[Error][4]** Invalid parameters * Throws **[Error][4]** Invalid parameters
Returns **Sharp** Returns **Sharp**

View File

@ -6,49 +6,50 @@ Resize image to `width`, `height` or `width x height`.
When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are: When both a `width` and `height` are provided, the possible methods by which the image should **fit** these are:
- `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit. * `cover`: (default) Preserving aspect ratio, ensure the image covers both provided dimensions by cropping/clipping to fit.
- `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary. * `contain`: Preserving aspect ratio, contain within both provided dimensions using "letterboxing" where necessary.
- `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions. * `fill`: Ignore the aspect ratio of the input and stretch to both provided dimensions.
- `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified. * `inside`: Preserving aspect ratio, resize the image to be as large as possible while ensuring its dimensions are less than or equal to both those specified.
- `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified. * `outside`: Preserving aspect ratio, resize the image to be as small as possible while ensuring its dimensions are greater than or equal to both those specified.
Some of these values are based on the [object-fit][1] CSS property. Some of these values are based on the [object-fit][1] CSS property.
When using a `fit` of `cover` or `contain`, the default **position** is `centre`. Other options are: When using a `fit` of `cover` or `contain`, the default **position** is `centre`. Other options are:
- `sharp.position`: `top`, `right top`, `right`, `right bottom`, `bottom`, `left bottom`, `left`, `left top`. * `sharp.position`: `top`, `right top`, `right`, `right bottom`, `bottom`, `left bottom`, `left`, `left top`.
- `sharp.gravity`: `north`, `northeast`, `east`, `southeast`, `south`, `southwest`, `west`, `northwest`, `center` or `centre`. * `sharp.gravity`: `north`, `northeast`, `east`, `southeast`, `south`, `southwest`, `west`, `northwest`, `center` or `centre`.
- `sharp.strategy`: `cover` only, dynamically crop using either the `entropy` or `attention` strategy. * `sharp.strategy`: `cover` only, dynamically crop using either the `entropy` or `attention` strategy.
Some of these values are based on the [object-position][2] CSS property. Some of these values are based on the [object-position][2] CSS property.
The experimental strategy-based approach resizes so one dimension is at its target length The experimental strategy-based approach resizes so one dimension is at its target length
then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy. then repeatedly ranks edge regions, discarding the edge with the lowest score based on the selected strategy.
- `entropy`: focus on the region with the highest [Shannon entropy][3]. * `entropy`: focus on the region with the highest [Shannon entropy][3].
- `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones. * `attention`: focus on the region with the highest luminance frequency, colour saturation and presence of skin tones.
Possible interpolation kernels are: Possible interpolation kernels are:
- `nearest`: Use [nearest neighbour interpolation][4]. * `nearest`: Use [nearest neighbour interpolation][4].
- `cubic`: Use a [Catmull-Rom spline][5]. * `cubic`: Use a [Catmull-Rom spline][5].
- `mitchell`: Use a [Mitchell-Netravali spline][6]. * `mitchell`: Use a [Mitchell-Netravali spline][6].
- `lanczos2`: Use a [Lanczos kernel][7] with `a=2`. * `lanczos2`: Use a [Lanczos kernel][7] with `a=2`.
- `lanczos3`: Use a Lanczos kernel with `a=3` (the default). * `lanczos3`: Use a Lanczos kernel with `a=3` (the default).
### Parameters ### Parameters
- `width` **[number][8]?** pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height. * `width` **[number][8]?** pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height.
- `height` **[number][8]?** pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width. * `height` **[number][8]?** pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width.
- `options` **[Object][9]?** * `options` **[Object][9]?**
- `options.width` **[String][10]?** alternative means of specifying `width`. If both are present this take priority.
- `options.height` **[String][10]?** alternative means of specifying `height`. If both are present this take priority. * `options.width` **[String][10]?** alternative means of specifying `width`. If both are present this take priority.
- `options.fit` **[String][10]** how the image should be resized to fit both provided dimensions, one of `cover`, `contain`, `fill`, `inside` or `outside`. (optional, default `'cover'`) * `options.height` **[String][10]?** alternative means of specifying `height`. If both are present this take priority.
- `options.position` **[String][10]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`) * `options.fit` **[String][10]** how the image should be resized to fit both provided dimensions, one of `cover`, `contain`, `fill`, `inside` or `outside`. (optional, default `'cover'`)
- `options.background` **([String][10] \| [Object][9])** background colour when using a `fit` of `contain`, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`) * `options.position` **[String][10]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`)
- `options.kernel` **[String][10]** the kernel to use for image reduction. (optional, default `'lanczos3'`) * `options.background` **([String][10] | [Object][9])** background colour when using a `fit` of `contain`, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`)
- `options.withoutEnlargement` **[Boolean][12]** do not enlarge if the width _or_ height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. (optional, default `false`) * `options.kernel` **[String][10]** the kernel to use for image reduction. (optional, default `'lanczos3'`)
- `options.fastShrinkOnLoad` **[Boolean][12]** take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default `true`) * `options.withoutEnlargement` **[Boolean][12]** do not enlarge if the width *or* height are already less than the specified dimensions, equivalent to GraphicsMagick's `>` geometry option. (optional, default `false`)
* `options.fastShrinkOnLoad` **[Boolean][12]** take greater advantage of the JPEG and WebP shrink-on-load feature, which can lead to a slight moiré pattern on some images. (optional, default `true`)
### Examples ### Examples
@ -125,7 +126,7 @@ const scaleByHalf = await sharp(input)
); );
``` ```
- Throws **[Error][13]** Invalid parameters * Throws **[Error][13]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -136,12 +137,13 @@ This operation will always occur after resizing and extraction, if any.
### Parameters ### Parameters
- `extend` **([number][8] \| [Object][9])** single pixel count to add to all edges or an Object with per-edge counts * `extend` **([number][8] | [Object][9])** single pixel count to add to all edges or an Object with per-edge counts
- `extend.top` **[number][8]** (optional, default `0`)
- `extend.left` **[number][8]** (optional, default `0`) * `extend.top` **[number][8]** (optional, default `0`)
- `extend.bottom` **[number][8]** (optional, default `0`) * `extend.left` **[number][8]** (optional, default `0`)
- `extend.right` **[number][8]** (optional, default `0`) * `extend.bottom` **[number][8]** (optional, default `0`)
- `extend.background` **([String][10] \| [Object][9])** background colour, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`) * `extend.right` **[number][8]** (optional, default `0`)
* `extend.background` **([String][10] | [Object][9])** background colour, parsed by the [color][11] module, defaults to black without transparency. (optional, default `{r:0,g:0,b:0,alpha:1}`)
### Examples ### Examples
@ -170,7 +172,7 @@ sharp(input)
... ...
``` ```
- Throws **[Error][13]** Invalid parameters * Throws **[Error][13]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -178,17 +180,18 @@ Returns **Sharp**
Extract/crop a region of the image. Extract/crop a region of the image.
- Use `extract` before `resize` for pre-resize extraction. * Use `extract` before `resize` for pre-resize extraction.
- Use `extract` after `resize` for post-resize extraction. * Use `extract` after `resize` for post-resize extraction.
- Use `extract` before and after for both. * Use `extract` before and after for both.
### Parameters ### Parameters
- `options` **[Object][9]** describes the region to extract using integral pixel values * `options` **[Object][9]** describes the region to extract using integral pixel values
- `options.left` **[number][8]** zero-indexed offset from left edge
- `options.top` **[number][8]** zero-indexed offset from top edge * `options.left` **[number][8]** zero-indexed offset from left edge
- `options.width` **[number][8]** width of region to extract * `options.top` **[number][8]** zero-indexed offset from top edge
- `options.height` **[number][8]** height of region to extract * `options.width` **[number][8]** width of region to extract
* `options.height` **[number][8]** height of region to extract
### Examples ### Examples
@ -210,7 +213,7 @@ sharp(input)
}); });
``` ```
- Throws **[Error][13]** Invalid parameters * Throws **[Error][13]** Invalid parameters
Returns **Sharp** Returns **Sharp**
@ -224,10 +227,11 @@ will contain `trimOffsetLeft` and `trimOffsetTop` properties.
### Parameters ### Parameters
- `threshold` **[number][8]** the allowed difference from the top-left pixel, a number greater than zero. (optional, default `10`) * `threshold` **[number][8]** the allowed difference from the top-left pixel, a number greater than zero. (optional, default `10`)
<!---->
- Throws **[Error][13]** Invalid parameters * Throws **[Error][13]** Invalid parameters
Returns **Sharp** Returns **Sharp**

View File

@ -54,17 +54,18 @@ console.log(sharp.versions);
## cache ## cache
Gets or, when options are provided, sets the limits of _libvips'_ operation cache. Gets or, when options are provided, sets the limits of *libvips'* operation cache.
Existing entries in the cache will be trimmed after any change in limits. Existing entries in the cache will be trimmed after any change in limits.
This method always returns cache statistics, This method always returns cache statistics,
useful for determining how much working memory is required for a particular task. useful for determining how much working memory is required for a particular task.
### Parameters ### Parameters
- `options` **([Object][1] \| [boolean][10])** Object with the following attributes, or boolean where true uses default cache settings and false removes all caching (optional, default `true`) * `options` **([Object][1] | [boolean][10])** Object with the following attributes, or boolean where true uses default cache settings and false removes all caching (optional, default `true`)
- `options.memory` **[number][11]** is the maximum memory in MB to use for this cache (optional, default `50`)
- `options.files` **[number][11]** is the maximum number of files to hold open (optional, default `20`) * `options.memory` **[number][11]** is the maximum memory in MB to use for this cache (optional, default `50`)
- `options.items` **[number][11]** is the maximum number of operations to cache (optional, default `100`) * `options.files` **[number][11]** is the maximum number of files to hold open (optional, default `20`)
* `options.items` **[number][11]** is the maximum number of operations to cache (optional, default `100`)
### Examples ### Examples
@ -83,7 +84,7 @@ Returns **[Object][1]**
## concurrency ## concurrency
Gets or, when a concurrency is provided, sets Gets or, when a concurrency is provided, sets
the number of threads _libvips'_ should create to process each image. the number of threads *libvips'* should create to process each image.
The default value is the number of CPU cores, The default value is the number of CPU cores,
except when using glibc-based Linux without jemalloc, except when using glibc-based Linux without jemalloc,
@ -98,7 +99,7 @@ This method always returns the current concurrency.
### Parameters ### Parameters
- `concurrency` **[number][11]?** * `concurrency` **[number][11]?**
### Examples ### Examples
@ -114,8 +115,8 @@ Returns **[number][11]** concurrency
An EventEmitter that emits a `change` event when a task is either: An EventEmitter that emits a `change` event when a task is either:
- queued, waiting for _libuv_ to provide a worker thread * queued, waiting for *libuv* to provide a worker thread
- complete * complete
### Examples ### Examples
@ -129,8 +130,8 @@ sharp.queue.on('change', function(queueLength) {
Provides access to internal task counters. Provides access to internal task counters.
- queue is the number of tasks this module has queued waiting for _libuv_ to provide a worker thread from its pool. * queue is the number of tasks this module has queued waiting for *libuv* to provide a worker thread from its pool.
- process is the number of resize tasks currently being processed. * process is the number of resize tasks currently being processed.
### Examples ### Examples
@ -150,7 +151,7 @@ by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM N
### Parameters ### Parameters
- `simd` **[boolean][10]** (optional, default `true`) * `simd` **[boolean][10]** (optional, default `true`)
### Examples ### Examples

File diff suppressed because one or more lines are too long

View File

@ -121,7 +121,7 @@
"color": "^3.1.3", "color": "^3.1.3",
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"node-addon-api": "^3.1.0", "node-addon-api": "^3.1.0",
"prebuild-install": "^6.1.1", "prebuild-install": "^6.1.2",
"semver": "^7.3.5", "semver": "^7.3.5",
"simple-get": "^3.1.0", "simple-get": "^3.1.0",
"tar-fs": "^2.1.1", "tar-fs": "^2.1.1",
@ -131,12 +131,12 @@
"async": "^3.2.0", "async": "^3.2.0",
"cc": "^3.0.1", "cc": "^3.0.1",
"decompress-zip": "^0.3.3", "decompress-zip": "^0.3.3",
"documentation": "^13.2.1", "documentation": "^13.2.5",
"exif-reader": "^1.0.3", "exif-reader": "^1.0.3",
"icc": "^2.0.0", "icc": "^2.0.0",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"mocha": "^8.3.2", "mocha": "^8.3.2",
"mock-fs": "^4.13.0", "mock-fs": "^4.14.0",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"prebuild": "^10.0.1", "prebuild": "^10.0.1",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",