diff --git a/docs/api-channel.md b/docs/api-channel.md index 3b3b75d7..892b2bdf 100644 --- a/docs/api-channel.md +++ b/docs/api-channel.md @@ -25,7 +25,7 @@ This is a no-op if the image already has an alpha channel. ### 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 @@ -43,13 +43,13 @@ const rgba = await sharp(rgb) .toBuffer(); ``` -- Throws **[Error][2]** Invalid alpha transparency level +* Throws **[Error][2]** Invalid alpha transparency level Returns **Sharp** **Meta** -- **since**: 0.21.2 +* **since**: 0.21.2 ## extractChannel @@ -57,7 +57,7 @@ Extract a single channel from a multi-channel image. ### 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 @@ -71,7 +71,7 @@ sharp(input) }); ``` -- Throws **[Error][2]** Invalid channel +* Throws **[Error][2]** Invalid channel 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. Channel ordering follows vips convention: -- sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. -- CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. +* sRGB: 0: Red, 1: Green, 2: Blue, 3: Alpha. +* CMYK: 0: Magenta, 1: Cyan, 2: Yellow, 3: Black, 4: Alpha. 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. ### Parameters -- `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. +* `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. + -- Throws **[Error][2]** Invalid parameters +* Throws **[Error][2]** Invalid parameters Returns **Sharp** @@ -104,7 +105,7 @@ Perform a bitwise boolean operation on all input image channels (bands) to produ ### 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 @@ -118,7 +119,7 @@ sharp('3-channel-rgb-input.png') }); ``` -- Throws **[Error][2]** Invalid parameters +* Throws **[Error][2]** Invalid parameters Returns **Sharp** diff --git a/docs/api-colour.md b/docs/api-colour.md index 8dca338c..c2818eda 100644 --- a/docs/api-colour.md +++ b/docs/api-colour.md @@ -7,10 +7,11 @@ An alpha channel may be present and will be unchanged by the operation. ### 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** @@ -25,7 +26,7 @@ An alpha channel may be present, and will be unchanged by the operation. ### Parameters -- `greyscale` **[Boolean][5]** (optional, default `true`) +* `greyscale` **[Boolean][5]** (optional, default `true`) Returns **Sharp** @@ -35,7 +36,7 @@ Alternative spelling of `greyscale`. ### Parameters -- `grayscale` **[Boolean][5]** (optional, default `true`) +* `grayscale` **[Boolean][5]** (optional, default `true`) Returns **Sharp** @@ -46,7 +47,7 @@ By default output image will be web-friendly sRGB, with additional channels inte ### 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 @@ -57,7 +58,7 @@ await sharp(input) .toFile('16-bpp.png') ``` -- Throws **[Error][4]** Invalid parameters +* Throws **[Error][4]** Invalid parameters Returns **Sharp** @@ -67,10 +68,11 @@ Alternative spelling of `toColourspace`. ### Parameters -- `colorspace` **[string][1]?** output colorspace. +* `colorspace` **[string][1]?** output colorspace. + -- Throws **[Error][4]** Invalid parameters +* Throws **[Error][4]** Invalid parameters Returns **Sharp** diff --git a/docs/api-composite.md b/docs/api-composite.md index 32a343bc..0378865c 100644 --- a/docs/api-composite.md +++ b/docs/api-composite.md @@ -19,24 +19,28 @@ and [https://www.cairographics.org/operators/][2] ### Parameters -- `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.create.width` **[Number][7]?** - - `images[].input.create.height` **[Number][7]?** - - `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[].blend` **[String][6]** how to blend this image with the image below. (optional, default `'over'`) - - `images[].gravity` **[String][6]** gravity at which to place the overlay. (optional, default `'centre'`) - - `images[].top` **[Number][7]?** the pixel offset from the top edge. - - `images[].left` **[Number][7]?** the pixel offset from the left edge. - - `images[].tile` **[Boolean][9]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`) - - `images[].premultiplied` **[Boolean][9]** set to true to avoid premultipling the image below. Equivalent to the `--premultiplied` vips option. (optional, default `false`) - - `images[].density` **[Number][7]** number representing the DPI for vector overlay image. (optional, default `72`) - - `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]?** +* `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.create.width` **[Number][7]?** + * `images[].input.create.height` **[Number][7]?** + * `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[].blend` **[String][6]** how to blend this image with the image below. (optional, default `'over'`) + * `images[].gravity` **[String][6]** gravity at which to place the overlay. (optional, default `'centre'`) + * `images[].top` **[Number][7]?** the pixel offset from the top edge. + * `images[].left` **[Number][7]?** the pixel offset from the left edge. + * `images[].tile` **[Boolean][9]** set to true to repeat the overlay image across the entire image with the given `gravity`. (optional, default `false`) + * `images[].premultiplied` **[Boolean][9]** set to true to avoid premultipling the image below. Equivalent to the `--premultiplied` vips option. (optional, default `false`) + * `images[].density` **[Number][7]** number representing the DPI for vector overlay image. (optional, default `72`) + * `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 @@ -57,13 +61,13 @@ sharp('input.png') }); ``` -- Throws **[Error][10]** Invalid parameters +* Throws **[Error][10]** Invalid parameters Returns **Sharp** **Meta** -- **since**: 0.22.0 +* **since**: 0.22.0 [1]: https://libvips.github.io/libvips/API/current/libvips-conversion.html#VipsBlendMode diff --git a/docs/api-constructor.md b/docs/api-constructor.md index 55d88c44..371407d9 100644 --- a/docs/api-constructor.md +++ b/docs/api-constructor.md @@ -13,37 +13,41 @@ Implements the [stream.Duplex][1] class. ### Parameters -- `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 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. -- `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.limitInputPixels` **([number][8] \| [boolean][7])** Do not process input images where the number of pixels - (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted. - An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default `268402689`) - - `options.sequentialRead` **[boolean][7]** Set this to `true` to use sequential rather than random access where possible. - This can reduce memory usage and might improve performance on some systems. (optional, default `false`) - - `options.density` **[number][8]** number representing the DPI for vector images in the range 1 to 100000. (optional, default `72`) - - `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.page` **[number][8]** page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), 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.level` **[number][8]** level to extract from a multi-level input (OpenSlide), zero based. (optional, default `0`) - - `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` **[Object][6]?** describes raw pixel input image data. See `raw()` for pixel ordering. - - `options.raw.width` **[number][8]?** integral number of pixels wide. - - `options.raw.height` **[number][8]?** integral number of pixels high. - - `options.raw.channels` **[number][8]?** integral number of channels, between 1 and 4. - - `options.create` **[Object][6]?** describes a new image to be created. - - `options.create.width` **[number][8]?** integral number of pixels wide. - - `options.create.height` **[number][8]?** integral number of pixels high. - - `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.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. +* `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 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. +* `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.limitInputPixels` **([number][8] | [boolean][7])** Do not process input images where the number of pixels + (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted. + An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF). (optional, default `268402689`) + * `options.sequentialRead` **[boolean][7]** Set this to `true` to use sequential rather than random access where possible. + This can reduce memory usage and might improve performance on some systems. (optional, default `false`) + * `options.density` **[number][8]** number representing the DPI for vector images in the range 1 to 100000. (optional, default `72`) + * `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.page` **[number][8]** page number to start extracting from for multi-page input (GIF, WebP, AVIF, TIFF, PDF), 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.level` **[number][8]** level to extract from a multi-level input (OpenSlide), zero based. (optional, default `0`) + * `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` **[Object][6]?** describes raw pixel input image data. See `raw()` for pixel ordering. + + * `options.raw.width` **[number][8]?** integral number of pixels wide. + * `options.raw.height` **[number][8]?** integral number of pixels high. + * `options.raw.channels` **[number][8]?** integral number of channels, between 1 and 4. + * `options.create` **[Object][6]?** describes a new image to be created. + + * `options.create.width` **[number][8]?** integral number of pixels wide. + * `options.create.height` **[number][8]?** integral number of pixels high. + * `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.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 @@ -120,7 +124,7 @@ await sharp({ }).toFile('noise.png'); ``` -- Throws **[Error][10]** Invalid parameters +* Throws **[Error][10]** Invalid parameters Returns **[Sharp][11]** diff --git a/docs/api-input.md b/docs/api-input.md index 1e6092f0..9c1167a3 100644 --- a/docs/api-input.md +++ b/docs/api-input.md @@ -5,35 +5,35 @@ Fast access to (uncached) image metadata without decoding any compressed image data. 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` -- `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) -- `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] -- `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] -- `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 -- `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 -- `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. -- `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 -- `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 -- `hasProfile`: Boolean indicating the presence of an embedded ICC profile -- `hasAlpha`: Boolean indicating the presence of an alpha transparency channel -- `orientation`: Number value of the EXIF Orientation header, if present -- `exif`: Buffer containing raw EXIF data, if present -- `icc`: Buffer containing raw [ICC][3] profile data, if present -- `iptc`: Buffer containing raw IPTC data, if present -- `xmp`: Buffer containing raw XMP data, if present -- `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present +* `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 +* `width`: Number of pixels wide (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] +* `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] +* `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 +* `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 +* `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. +* `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 +* `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 +* `hasProfile`: Boolean indicating the presence of an embedded ICC profile +* `hasAlpha`: Boolean indicating the presence of an alpha transparency channel +* `orientation`: Number value of the EXIF Orientation header, if present +* `exif`: Buffer containing raw EXIF data, if present +* `icc`: Buffer containing raw [ICC][3] profile data, if present +* `iptc`: Buffer containing raw IPTC data, if present +* `xmp`: Buffer containing raw XMP data, if present +* `tifftagPhotoshop`: Buffer containing raw TIFFTAG_PHOTOSHOP data, if present ### Parameters -- `callback` **[Function][4]?** called with the arguments `(err, metadata)` +* `callback` **[Function][4]?** called with the arguments `(err, metadata)` ### Examples @@ -52,32 +52,32 @@ image }); ``` -Returns **([Promise][5]<[Object][6]> | Sharp)** +Returns **([Promise][5]<[Object][6]> | Sharp)** ## stats Access to pixel-derived image statistics for every channel in the image. A `Promise` is returned when `callback` is not provided. -- `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains - - `min` (minimum value in the channel) - - `max` (maximum value in the channel) - - `sum` (sum of all values in a channel) - - `squaresSum` (sum of squared values in a channel) - - `mean` (mean of 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) - - `minY` (y-coordinate of one of the pixel where the minimum 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) -- `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) -- `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) +* `channels`: Array of channel statistics for each channel in the image. Each channel statistic contains + * `min` (minimum value in the channel) + * `max` (maximum value in the channel) + * `sum` (sum of all values in a channel) + * `squaresSum` (sum of squared values in a channel) + * `mean` (mean of 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) + * `minY` (y-coordinate of one of the pixel where the minimum 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) +* `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) +* `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) ### Parameters -- `callback` **[Function][4]?** called with the arguments `(err, stats)` +* `callback` **[Function][4]?** called with the arguments `(err, stats)` ### Examples @@ -95,7 +95,7 @@ const { entropy, sharpness, dominant } = await sharp(input).stats(); const { r, g, b } = dominant; ``` -Returns **[Promise][5]<[Object][6]>** +Returns **[Promise][5]<[Object][6]>** [1]: https://libvips.github.io/libvips/API/current/VipsImage.html#VipsInterpretation diff --git a/docs/api-operation.md b/docs/api-operation.md index 6b739ff9..037c95d8 100644 --- a/docs/api-operation.md +++ b/docs/api-operation.md @@ -21,9 +21,10 @@ for example `rotate(x).extract(y)` will produce a different result to `extract(y ### Parameters -- `angle` **[number][1]** angle of rotation. (optional, default `auto`) -- `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"`) +* `angle` **[number][1]** angle of rotation. (optional, default `auto`) +* `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"`) ### Examples @@ -39,7 +40,7 @@ const pipeline = sharp() readableStream.pipe(pipeline); ``` -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** @@ -50,7 +51,7 @@ The use of `flip` implies the removal of the EXIF `Orientation` tag, if any. ### Parameters -- `flip` **[Boolean][6]** (optional, default `true`) +* `flip` **[Boolean][6]** (optional, default `true`) Returns **Sharp** @@ -61,7 +62,7 @@ The use of `flop` implies the removal of the EXIF `Orientation` tag, if any. ### Parameters -- `flop` **[Boolean][6]** (optional, default `true`) +* `flop` **[Boolean][6]** (optional, default `true`) 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: -- X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` -- Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody` +* X = `matrix[0, 0]` \* (x + `idx`) + `matrix[0, 1]` \* (y + `idy`) + `odx` +* Y = `matrix[1, 0]` \* (x + `idx`) + `matrix[1, 1]` \* (y + `idy`) + `ody` where: -- x and y are the coordinates in input image. -- X and Y are the coordinates in output image. -- (0,0) is the upper left corner. +* x and y are the coordinates in input image. +* X and Y are the coordinates in output image. +* (0,0) is the upper left corner. ### Parameters -- `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.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.idy` **[Number][1]** input vertical offset (optional, default `0`) - - `options.odx` **[Number][1]** output horizontal offset (optional, default `0`) - - `options.ody` **[Number][1]** output vertical offset (optional, default `0`) - - `options.interpolator` **[String][3]** interpolator (optional, default `sharp.interpolators.bicubic`) +* `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.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.idy` **[Number][1]** input vertical offset (optional, default `0`) + * `options.odx` **[Number][1]** output horizontal offset (optional, default `0`) + * `options.ody` **[Number][1]** output vertical offset (optional, default `0`) + * `options.interpolator` **[String][3]** interpolator (optional, default `sharp.interpolators.bicubic`) ### Examples @@ -112,13 +114,13 @@ inputStream .pipe(pipeline); ``` -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** **Meta** -- **since**: 0.27.0 +* **since**: 0.27.0 ## sharpen @@ -129,12 +131,13 @@ Separate control over the level of sharpening in "flat" and "jagged" areas is av ### Parameters -- `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`) -- `jagged` **[number][1]** the level of sharpening to apply to "jagged" areas. (optional, default `2.0`) +* `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`) +* `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** @@ -145,10 +148,11 @@ When used without parameters the default window is 3x3. ### 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** @@ -160,10 +164,11 @@ When a `sigma` is provided, performs a slower, more accurate Gaussian blur. ### 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** @@ -173,8 +178,9 @@ Merge alpha transparency channel, if any, with a background, then remove the alp ### Parameters -- `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` **[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}`) ### Examples @@ -198,11 +204,12 @@ Supply a second argument to use a different output gamma value, otherwise the fi ### Parameters -- `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`) +* `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`) + -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** @@ -212,7 +219,7 @@ Produce the "negative" of the image. ### Parameters -- `negate` **[Boolean][6]** (optional, default `true`) +* `negate` **[Boolean][6]** (optional, default `true`) Returns **Sharp** @@ -222,7 +229,7 @@ Enhance output image contrast by stretching its luminance to cover the full dyna ### Parameters -- `normalise` **[Boolean][6]** (optional, default `true`) +* `normalise` **[Boolean][6]** (optional, default `true`) Returns **Sharp** @@ -232,7 +239,7 @@ Alternative spelling of normalise. ### Parameters -- `normalize` **[Boolean][6]** (optional, default `true`) +* `normalize` **[Boolean][6]** (optional, default `true`) Returns **Sharp** @@ -242,12 +249,13 @@ Convolve the image with the specified kernel. ### Parameters -- `kernel` **[Object][2]** - - `kernel.width` **[number][1]** width of the kernel in pixels. - - `kernel.height` **[number][1]** width of the kernel in pixels. - - `kernel.kernel` **[Array][7]<[number][1]>** Array of length `width*height` containing the kernel values. - - `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`) +* `kernel` **[Object][2]** + + * `kernel.width` **[number][1]** width of the kernel in pixels. + * `kernel.height` **[number][1]** width of the kernel in pixels. + * `kernel.kernel` **[Array][7]<[number][1]>** Array of length `width*height` containing the kernel values. + * `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 @@ -265,7 +273,7 @@ sharp(input) }); ``` -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** @@ -275,13 +283,15 @@ Any pixel value greater than or equal to the threshold value will be set to 255, ### Parameters -- `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.greyscale` **[Boolean][6]** convert to single channel greyscale. (optional, default `true`) - - `options.grayscale` **[Boolean][6]** alternative spelling for greyscale. (optional, default `true`) +* `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.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** @@ -294,16 +304,19 @@ the selected bitwise boolean `operation` between the corresponding pixels of the ### Parameters -- `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. -- `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]?** +* `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. +* `options` **[Object][2]?** + * `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** @@ -313,11 +326,12 @@ Apply the linear formula a \* input + b to the image (levels adjustment) ### Parameters -- `a` **[number][1]** multiplier (optional, default `1.0`) -- `b` **[number][1]** offset (optional, default `0.0`) +* `a` **[number][1]** multiplier (optional, default `1.0`) +* `b` **[number][1]** offset (optional, default `0.0`) + -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** @@ -327,7 +341,7 @@ Recomb the image with the specified matrix. ### Parameters -- `inputMatrix` **[Array][7]<[Array][7]<[number][1]>>** 3x3 Recombination matrix +* `inputMatrix` **[Array][7]<[Array][7]<[number][1]>>** 3x3 Recombination matrix ### Examples @@ -345,13 +359,13 @@ sharp(input) }); ``` -- Throws **[Error][5]** Invalid parameters +* Throws **[Error][5]** Invalid parameters Returns **Sharp** **Meta** -- **since**: 0.21.1 +* **since**: 0.21.1 ## modulate @@ -359,10 +373,11 @@ Transforms the image using brightness, saturation and hue rotation. ### Parameters -- `options` **[Object][2]?** - - `options.brightness` **[number][1]?** Brightness multiplier - - `options.saturation` **[number][1]?** Saturation multiplier - - `options.hue` **[number][1]?** Degrees for hue rotation +* `options` **[Object][2]?** + + * `options.brightness` **[number][1]?** Brightness multiplier + * `options.saturation` **[number][1]?** Saturation multiplier + * `options.hue` **[number][1]?** Degrees for hue rotation ### Examples @@ -390,7 +405,7 @@ Returns **Sharp** **Meta** -- **since**: 0.22.1 +* **since**: 0.22.1 [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/docs/api-output.md b/docs/api-output.md index 4795930d..ad509d92 100644 --- a/docs/api-output.md +++ b/docs/api-output.md @@ -15,8 +15,8 @@ A `Promise` is returned when `callback` is not provided. ### Parameters -- `fileOut` **[string][2]** the path to write the image data to. -- `callback` **[Function][3]?** called on completion with two arguments `(err, info)`. +* `fileOut` **[string][2]** the path to write the image data to. +* `callback` **[Function][3]?** called on completion with two arguments `(err, info)`. `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`. @@ -35,9 +35,9 @@ sharp(input) .catch(err => { ... }); ``` -- Throws **[Error][4]** Invalid parameters +* Throws **[Error][4]** Invalid parameters -Returns **[Promise][5]<[Object][6]>** when no callback is provided +Returns **[Promise][5]<[Object][6]>** when no callback is provided ## toBuffer @@ -51,19 +51,21 @@ See [withMetadata][1] for control over this. `callback`, if present, gets three arguments `(err, data, info)` where: -- `err` is an error, if any. -- `data` is the output image data. -- `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`. +* `err` is an error, if any. +* `data` is the output image data. +* `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`. A `Promise` is returned when `callback` is not provided. ### Parameters -- `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` **[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]?** ### Examples @@ -103,7 +105,7 @@ await sharp(pixelArray, { raw: { width, height, channels } }) .toFile('my-changed-image.jpg'); ``` -Returns **[Promise][5]<[Buffer][8]>** when no callback is provided +Returns **[Promise][5]<[Buffer][8]>** when no callback is provided ## withMetadata @@ -116,11 +118,12 @@ sRGB colour space and strip all metadata, including the removal of any ICC profi ### Parameters -- `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.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). +* `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.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 @@ -150,7 +153,7 @@ const data = await sharp(input) .toBuffer(); ``` -- Throws **[Error][4]** Invalid parameters +* Throws **[Error][4]** Invalid parameters Returns **Sharp** @@ -160,8 +163,8 @@ Force output to a given format. ### Parameters -- `format` **([string][2] \| [Object][6])** as a string or an Object with an 'id' attribute -- `options` **[Object][6]** output options +* `format` **([string][2] | [Object][6])** as a string or an Object with an 'id' attribute +* `options` **[Object][6]** output options ### Examples @@ -172,7 +175,7 @@ const data = await sharp(input) .toBuffer(); ``` -- Throws **[Error][4]** unsupported format or options +* Throws **[Error][4]** unsupported format or options Returns **Sharp** @@ -182,20 +185,21 @@ Use these JPEG options for output image. ### Parameters -- `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.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.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`) - - `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`) - - `options.mozjpeg` **[boolean][7]** use mozjpeg defaults, equivalent to `{ trellisQuantisation: true, overshootDeringing: true, optimiseScans: true, quantisationTable: 3 }` (optional, default `false`) - - `options.trellisQuantisation` **[boolean][7]** apply trellis quantisation (optional, default `false`) - - `options.overshootDeringing` **[boolean][7]** apply overshoot deringing (optional, default `false`) - - `options.optimiseScans` **[boolean][7]** optimise progressive scans, forces progressive (optional, default `false`) - - `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans (optional, default `false`) - - `options.quantisationTable` **[number][9]** quantization table to use, integer 0-8 (optional, default `0`) - - `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`) +* `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.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.optimiseCoding` **[boolean][7]** optimise Huffman coding tables (optional, default `true`) + * `options.optimizeCoding` **[boolean][7]** alternative spelling of optimiseCoding (optional, default `true`) + * `options.mozjpeg` **[boolean][7]** use mozjpeg defaults, equivalent to `{ trellisQuantisation: true, overshootDeringing: true, optimiseScans: true, quantisationTable: 3 }` (optional, default `false`) + * `options.trellisQuantisation` **[boolean][7]** apply trellis quantisation (optional, default `false`) + * `options.overshootDeringing` **[boolean][7]** apply overshoot deringing (optional, default `false`) + * `options.optimiseScans` **[boolean][7]** optimise progressive scans, forces progressive (optional, default `false`) + * `options.optimizeScans` **[boolean][7]** alternative spelling of optimiseScans (optional, default `false`) + * `options.quantisationTable` **[number][9]** quantization table to use, integer 0-8 (optional, default `0`) + * `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 @@ -216,7 +220,7 @@ const data = await sharp(input) .toBuffer(); ``` -- Throws **[Error][4]** Invalid options +* Throws **[Error][4]** Invalid options Returns **Sharp** @@ -230,16 +234,17 @@ Set `palette` to `true` for slower, indexed PNG output. ### Parameters -- `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.adaptiveFiltering` **[boolean][7]** use adaptive row filtering (optional, default `false`) - - `options.palette` **[boolean][7]** quantise to a palette-based image with alpha transparency support (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.colours` **[number][9]** maximum number of palette entries, sets `palette` to `true` (optional, default `256`) - - `options.colors` **[number][9]** alternative spelling of `options.colours`, 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.force` **[boolean][7]** force PNG output, otherwise attempt to use input format (optional, default `true`) +* `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.adaptiveFiltering` **[boolean][7]** use adaptive row filtering (optional, default `false`) + * `options.palette` **[boolean][7]** quantise to a palette-based image with alpha transparency support (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.colours` **[number][9]** maximum number of palette entries, sets `palette` to `true` (optional, default `256`) + * `options.colors` **[number][9]** alternative spelling of `options.colours`, 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.force` **[boolean][7]** force PNG output, otherwise attempt to use input format (optional, default `true`) ### Examples @@ -257,7 +262,7 @@ const data = await sharp(input) .toBuffer(); ``` -- Throws **[Error][4]** Invalid options +* Throws **[Error][4]** Invalid options Returns **Sharp** @@ -267,17 +272,18 @@ Use these WebP options for output image. ### Parameters -- `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.lossless` **[boolean][7]** use 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.reductionEffort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (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.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`) +* `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.lossless` **[boolean][7]** use 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.reductionEffort` **[number][9]** level of CPU effort to reduce file size, integer 0-6 (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.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 @@ -295,7 +301,7 @@ const outputWebp = await sharp(inputWebp, { animated: true }) .toBuffer(); ``` -- Throws **[Error][4]** Invalid options +* Throws **[Error][4]** Invalid options Returns **Sharp** @@ -309,14 +315,16 @@ The prebuilt binaries do not include this - see ### Parameters -- `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]<[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` **[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]<[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** @@ -326,18 +334,19 @@ Use these TIFF options for output image. ### Parameters -- `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.compression` **[string][2]** compression options: lzw, deflate, jpeg, ccittfax4 (optional, default `'jpeg'`) - - `options.predictor` **[string][2]** compression predictor options: none, horizontal, float (optional, default `'horizontal'`) - - `options.pyramid` **[boolean][7]** write an image pyramid (optional, default `false`) - - `options.tile` **[boolean][7]** write a tiled tiff (optional, default `false`) - - `options.tileWidth` **[number][9]** horizontal tile size (optional, default `256`) - - `options.tileHeight` **[number][9]** vertical tile size (optional, default `256`) - - `options.xres` **[number][9]** horizontal resolution in pixels/mm (optional, default `1.0`) - - `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`) +* `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.compression` **[string][2]** compression options: lzw, deflate, jpeg, ccittfax4 (optional, default `'jpeg'`) + * `options.predictor` **[string][2]** compression predictor options: none, horizontal, float (optional, default `'horizontal'`) + * `options.pyramid` **[boolean][7]** write an image pyramid (optional, default `false`) + * `options.tile` **[boolean][7]** write a tiled tiff (optional, default `false`) + * `options.tileWidth` **[number][9]** horizontal tile size (optional, default `256`) + * `options.tileHeight` **[number][9]** vertical tile size (optional, default `256`) + * `options.xres` **[number][9]** horizontal resolution in pixels/mm (optional, default `1.0`) + * `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 @@ -352,7 +361,7 @@ sharp('input.svg') .then(info => { ... }); ``` -- Throws **[Error][4]** Invalid options +* Throws **[Error][4]** Invalid options Returns **Sharp** @@ -365,20 +374,22 @@ most web browsers do not display these properly. ### Parameters -- `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` **[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'`) -- Throws **[Error][4]** Invalid options + + +* Throws **[Error][4]** Invalid options Returns **Sharp** **Meta** -- **since**: 0.27.0 +* **since**: 0.27.0 ## heif @@ -389,21 +400,23 @@ globally-installed libvips compiled with support for libheif, libde265 and x265. ### Parameters -- `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` **[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'`) -- Throws **[Error][4]** Invalid options + + +* Throws **[Error][4]** Invalid options Returns **Sharp** **Meta** -- **since**: 0.23.0 +* **since**: 0.23.0 ## raw @@ -442,18 +455,19 @@ Warning: multiple sharp instances concurrently producing tile output can expose ### Parameters -- `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.angle` **[number][9]** tile angle of rotation, must be a multiple of 90. (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.depth` **[string][2]?** how deep to make the pyramid, possible values are `onepixel`, `onetile` or `one`, default based on layout. - - `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.container` **[string][2]** tile container, with value `fs` (filesystem) or `zip` (compressed file). (optional, default `'fs'`) - - `options.layout` **[string][2]** filesystem layout, possible values are `dz`, `iiif`, `zoomify` or `google`. (optional, default `'dz'`) - - `options.centre` **[boolean][7]** centre image in tile. (optional, default `false`) - - `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'`) +* `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.angle` **[number][9]** tile angle of rotation, must be a multiple of 90. (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.depth` **[string][2]?** how deep to make the pyramid, possible values are `onepixel`, `onetile` or `one`, default based on layout. + * `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.container` **[string][2]** tile container, with value `fs` (filesystem) or `zip` (compressed file). (optional, default `'fs'`) + * `options.layout` **[string][2]** filesystem layout, possible values are `dz`, `iiif`, `zoomify` or `google`. (optional, default `'dz'`) + * `options.centre` **[boolean][7]** centre image in tile. (optional, default `false`) + * `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 @@ -469,7 +483,7 @@ sharp('input.tiff') }); ``` -- Throws **[Error][4]** Invalid parameters +* Throws **[Error][4]** Invalid parameters Returns **Sharp** diff --git a/docs/api-resize.md b/docs/api-resize.md index 5fac17f0..d4059470 100644 --- a/docs/api-resize.md +++ b/docs/api-resize.md @@ -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: -- `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. -- `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. -- `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. +* `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. +* `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. +* `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. 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.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.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.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. 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. -- `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. +* `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. Possible interpolation kernels are: -- `nearest`: Use [nearest neighbour interpolation][4]. -- `cubic`: Use a [Catmull-Rom spline][5]. -- `mitchell`: Use a [Mitchell-Netravali spline][6]. -- `lanczos2`: Use a [Lanczos kernel][7] with `a=2`. -- `lanczos3`: Use a Lanczos kernel with `a=3` (the default). +* `nearest`: Use [nearest neighbour interpolation][4]. +* `cubic`: Use a [Catmull-Rom spline][5]. +* `mitchell`: Use a [Mitchell-Netravali spline][6]. +* `lanczos2`: Use a [Lanczos kernel][7] with `a=2`. +* `lanczos3`: Use a Lanczos kernel with `a=3` (the default). ### Parameters -- `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. -- `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.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.position` **[String][10]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`) - - `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.kernel` **[String][10]** the kernel to use for image reduction. (optional, default `'lanczos3'`) - - `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`) +* `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. +* `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.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.position` **[String][10]** position, gravity or strategy to use when `fit` is `cover` or `contain`. (optional, default `'centre'`) + * `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.kernel` **[String][10]** the kernel to use for image reduction. (optional, default `'lanczos3'`) + * `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 @@ -125,7 +126,7 @@ const scaleByHalf = await sharp(input) ); ``` -- Throws **[Error][13]** Invalid parameters +* Throws **[Error][13]** Invalid parameters Returns **Sharp** @@ -136,12 +137,13 @@ This operation will always occur after resizing and extraction, if any. ### Parameters -- `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.bottom` **[number][8]** (optional, default `0`) - - `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}`) +* `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.bottom` **[number][8]** (optional, default `0`) + * `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 @@ -170,7 +172,7 @@ sharp(input) ... ``` -- Throws **[Error][13]** Invalid parameters +* Throws **[Error][13]** Invalid parameters Returns **Sharp** @@ -178,17 +180,18 @@ Returns **Sharp** Extract/crop a region of the image. -- Use `extract` before `resize` for pre-resize extraction. -- Use `extract` after `resize` for post-resize extraction. -- Use `extract` before and after for both. +* Use `extract` before `resize` for pre-resize extraction. +* Use `extract` after `resize` for post-resize extraction. +* Use `extract` before and after for both. ### Parameters -- `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.width` **[number][8]** width of region to extract - - `options.height` **[number][8]** height of region to extract +* `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.width` **[number][8]** width of region to extract + * `options.height` **[number][8]** height of region to extract ### Examples @@ -210,7 +213,7 @@ sharp(input) }); ``` -- Throws **[Error][13]** Invalid parameters +* Throws **[Error][13]** Invalid parameters Returns **Sharp** @@ -224,10 +227,11 @@ will contain `trimOffsetLeft` and `trimOffsetTop` properties. ### 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** diff --git a/docs/api-utility.md b/docs/api-utility.md index 01a0bd3c..10812f64 100644 --- a/docs/api-utility.md +++ b/docs/api-utility.md @@ -54,17 +54,18 @@ console.log(sharp.versions); ## 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. This method always returns cache statistics, useful for determining how much working memory is required for a particular task. ### 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.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.items` **[number][11]** is the maximum number of operations to cache (optional, default `100`) +* `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.items` **[number][11]** is the maximum number of operations to cache (optional, default `100`) ### Examples @@ -83,7 +84,7 @@ Returns **[Object][1]** ## concurrency 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, except when using glibc-based Linux without jemalloc, @@ -98,7 +99,7 @@ This method always returns the current concurrency. ### Parameters -- `concurrency` **[number][11]?** +* `concurrency` **[number][11]?** ### Examples @@ -114,8 +115,8 @@ Returns **[number][11]** concurrency An EventEmitter that emits a `change` event when a task is either: -- queued, waiting for _libuv_ to provide a worker thread -- complete +* queued, waiting for *libuv* to provide a worker thread +* complete ### Examples @@ -129,8 +130,8 @@ sharp.queue.on('change', function(queueLength) { 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. -- process is the number of resize tasks currently being processed. +* 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. ### Examples @@ -150,7 +151,7 @@ by taking advantage of the SIMD vector unit of the CPU, e.g. Intel SSE and ARM N ### Parameters -- `simd` **[boolean][10]** (optional, default `true`) +* `simd` **[boolean][10]** (optional, default `true`) ### Examples diff --git a/docs/search-index.json b/docs/search-index.json index 5bb37e01..14d334fa 100644 --- a/docs/search-index.json +++ b/docs/search-index.json @@ -1 +1 @@ -[{"t":"Prerequisites","d":"Node.js v10","k":"prerequisites node","l":"/install#prerequisites"},{"t":"Prebuilt binaries","d":"Ready-compiled sharp and libvips binaries are provided for use with Node.js v10 on the most common platforms macOS x64 10.13 Linux x64 glibc 2.17, musl 1.1.24 Linux ARM64 glibc 2.2","k":"prebuilt binaries compiled sharp libvips node common platforms macos linux glibc musl arm","l":"/install#prebuilt-binaries"},{"t":"Common problems","d":"The architecture and platform of Node.js used for npm install must be the same as the architecture and platform of Node.js used at runtime. When using npm v6 or earlier, the npm in","k":"common problems architecture platform node npm install runtime earlier","l":"/install#common-problems"},{"t":"Apple M1","d":"Prebuilt libvips binaries are provided for macOS on ARM64 since sharp v0.28.0. During npm install sharp will be built locally, which requires Xcode and Python - see building from s","k":"apple prebuilt libvips binaries macos arm sharp during npm install built locally requires xcode python building","l":"/install#apple-m1"},{"t":"Custom libvips","d":"To use a custom, globally-installed version of libvips instead of the provided binaries, make sure it is at least the version listed under config.libvips in the package.json file a","k":"custom libvips globally installed version instead binaries make listed config package json file","l":"/install#custom-libvips"},{"t":"Building from source","d":"This module will be compiled from source at npm install time when a globally-installed libvips is detected set the SHARP_IGNORE_GLOBAL_LIBVIPS environment variable to skip this, pr","k":"building source module compiled npm install time globally installed libvips detected environment variable skip","l":"/install#building-from-source"},{"t":"Custom prebuilt binaries","d":"This is an advanced approach that most people will not require. To install the prebuilt sharp binaries from a custom URL, set the sharp_binary_host npm config option or the npm_con","k":"custom prebuilt binaries advanced approach people require install sharp url npm config option npmcon","l":"/install#custom-prebuilt-binaries"},{"t":"Chinese mirror","d":"Alibaba provide a mirror site based in China containing binaries for both sharp and libvips. To use this either set the following configuration sh npm config set sharp_binary_host","k":"chinese mirror alibaba site china binaries sharp libvips following configuration npm config","l":"/install#chinese-mirror"},{"t":"FreeBSD","d":"The vips package must be installed before npm install is run. sh pkg install -y pkgconf vips sh cd /usr/ports/graphics/vips/ make install clean","k":"freebsd vips package installed npm install run pkg pkgconf usr ports graphics make clean","l":"/install#freebsd"},{"t":"Linux memory allocator","d":"The default memory allocator on most glibc-based Linux systems e.g. Debian, Red Hat is unsuitable for long-running, multi-threaded processes that involve lots of small memory alloc","k":"linux memory allocator glibc systems debian red hat unsuitable long running multi threaded processes small alloc","l":"/install#linux-memory-allocator"},{"t":"Heroku","d":"Add the jemalloc buildpack to reduce the effects of memory fragmentation. Set NODE_MODULES_CACHE","k":"heroku add jemalloc buildpack reduce effects memory fragmentation","l":"/install#heroku"},{"t":"AWS Lambda","d":"The binaries in the node_modules directory of the deployment package must be for the Linux x64 platform. When building your deployment package on machines other than Linux x64 glib","k":"aws lambda binaries nodemodules directory deployment package linux platform building your machines other than glib","l":"/install#aws-lambda"},{"t":"Webpack","d":"Ensure sharp is added to the externals configuration. js externals sharp commonjs sharp","k":"webpack sharp added externals configuration commonjs","l":"/install#webpack"},{"t":"Worker threads","d":"The main thread must call requiresharp before worker threads are created to ensure shared libraries remain loaded in memory until after all threads are complete.","k":"worker threads main thread requiresharp created shared libraries remain loaded memory complete","l":"/install#worker-threads"},{"t":"Canvas and Windows","d":"The prebuilt binaries provided by canvas for Windows depend on the unmaintained GTK 2, last updated in 2011. These conflict with the modern, up-to-date binaries provided by sharp.","k":"canvas windows prebuilt binaries depend unmaintained gtk last updated conflict modern date sharp","l":"/install#canvas-and-windows"},{"t":"Sharp","d":"Constructor factory to create an instance of sharp, to which further methods are chained.","k":"sharp constructor factory create instance further methods chained","l":"/api-constructor#sharp"},{"t":"clone","d":"Take a snapshot of the Sharp instance, returning a new instance. Cloned instances inherit the input of their parent instance. This allows multiple output Streams and therefore mult","k":"clone snapshot sharp instance returning new cloned instances inherit input parent multiple output streams mult","l":"/api-constructor#clone"},{"t":"metadata","d":"Fast access to uncached image metadata without decoding any compressed image data. A Promise is returned when callback is not provided.","k":"metadata fast access uncached decoding compressed data promise returned callback","l":"/api-input#metadata"},{"t":"stats","d":"Access to pixel-derived image statistics for every channel in the image. A Promise is returned when callback is not provided.","k":"stats access pixel derived statistics channel promise returned callback","l":"/api-input#stats"},{"t":"toFile","d":"Write output image data to a file.","k":"tofile write output data file","l":"/api-output#tofile"},{"t":"toBuffer","d":"Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF and raw pixel data output are supported.","k":"tobuffer write output buffer jpeg png webp avif tiff raw pixel data","l":"/api-output#tobuffer"},{"t":"withMetadata","d":"Include all metadata EXIF, XMP, IPTC from the input image in the output image. This will also convert to and add a web-friendly sRGB ICC profile unless a custom output profile is p","k":"withmetadata include metadata exif xmp iptc input output convert add web friendly srgb icc profile custom","l":"/api-output#withmetadata"},{"t":"toFormat","d":"Force output to a given format.","k":"toformat force output format","l":"/api-output#toformat"},{"t":"jpeg","d":"Use these JPEG options for output image.","k":"jpeg output","l":"/api-output#jpeg"},{"t":"png","d":"Use these PNG options for output image.","k":"png output","l":"/api-output#png"},{"t":"webp","d":"Use these WebP options for output image.","k":"webp output","l":"/api-output#webp"},{"t":"gif","d":"Use these GIF options for output image.","k":"gif output","l":"/api-output#gif"},{"t":"tiff","d":"Use these TIFF options for output image.","k":"tiff output","l":"/api-output#tiff"},{"t":"avif","d":"Use these AVIF options for output image.","k":"avif output","l":"/api-output#avif"},{"t":"heif","d":"Use these HEIF options for output image.","k":"heif output","l":"/api-output#heif"},{"t":"raw","d":"Force output to be raw, uncompressed, 8-bit unsigned integer unit8 pixel data. Pixel ordering is left-to-right, top-to-bottom, without padding. Channel ordering will be RGB or RGBA","k":"raw force output uncompressed bit unsigned integer unit pixel data ordering left right top bottom padding channel rgb rgba","l":"/api-output#raw"},{"t":"tile","d":"Use tile-based deep zoom image pyramid output. Set the format and options for tile images via the toFormat, jpeg, png or webp functions. Use a .zip or .szi file extension with toFi","k":"tile deep zoom pyramid output format images via toformat jpeg png webp functions zip szi file extension tofi","l":"/api-output#tile"},{"t":"resize","d":"Resize image to width, height or width x height.","k":"resize width height","l":"/api-resize#resize"},{"t":"extend","d":"Extends/pads the edges of the image with the provided background colour. This operation will always occur after resizing and extraction, if any.","k":"extend extends pads edges background colour operation resizing extraction","l":"/api-resize#extend"},{"t":"extract","d":"Extract/crop a region of the image.","k":"extract crop region","l":"/api-resize#extract"},{"t":"trim","d":"Trim boring pixels from all edges that contain values similar to the top-left pixel. Images consisting entirely of a single colour will calculate boring using the alpha channel, if","k":"trim boring pixels edges contain similar top left pixel images consisting entirely single colour calculate alpha channel","l":"/api-resize#trim"},{"t":"composite","d":"Composite images over the processed resized, extracted etc. image.","k":"composite images processed resized extracted","l":"/api-composite#composite"},{"t":"rotate","d":"Rotate the output image by either an explicit angle or auto-orient based on the EXIF Orientation tag.","k":"rotate output explicit angle auto orient exif orientation tag","l":"/api-operation#rotate"},{"t":"flip","d":"Flip the image about the vertical Y axis. This always occurs after rotation, if any. The use of flip implies the removal of the EXIF Orientation tag, if any.","k":"flip vertical axis rotation implies removal exif orientation tag","l":"/api-operation#flip"},{"t":"flop","d":"Flop the image about the horizontal X axis. This always occurs after rotation, if any. The use of flop implies the removal of the EXIF Orientation tag, if any.","k":"flop horizontal axis rotation implies removal exif orientation tag","l":"/api-operation#flop"},{"t":"affine","d":"Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any.","k":"affine transform operation resizing extraction rotation","l":"/api-operation#affine"},{"t":"sharpen","d":"Sharpen the image. When used without parameters, performs a fast, mild sharpen of the output image. When a sigma is provided, performs a slower, more accurate sharpen of the L chan","k":"sharpen parameters fast mild output sigma slower accurate chan","l":"/api-operation#sharpen"},{"t":"median","d":"Apply median filter. When used without parameters the default window is 3x3.","k":"median apply filter parameters window","l":"/api-operation#median"},{"t":"blur","d":"Blur the image. When used without parameters, performs a fast, mild blur of the output image. When a sigma is provided, performs a slower, more accurate Gaussian blur.","k":"blur parameters fast mild output sigma slower accurate gaussian","l":"/api-operation#blur"},{"t":"flatten","d":"Merge alpha transparency channel, if any, with a background, then remove the alpha channel.","k":"flatten merge alpha transparency channel background then remove","l":"/api-operation#flatten"},{"t":"gamma","d":"Apply a gamma correction by reducing the encoding darken pre-resize at a factor of 1/gamma then increasing the encoding brighten post-resize at a factor of gamma. This can improve","k":"gamma apply correction reducing encoding darken pre resize factor then increasing brighten post improve","l":"/api-operation#gamma"},{"t":"negate","d":"Produce the negative of the image.","k":"negate produce negative","l":"/api-operation#negate"},{"t":"normalise","d":"Enhance output image contrast by stretching its luminance to cover the full dynamic range.","k":"normalise enhance output contrast stretching luminance cover full dynamic range","l":"/api-operation#normalise"},{"t":"normalize","d":"Alternative spelling of normalise.","k":"normalize normalise","l":"/api-operation#normalize"},{"t":"convolve","d":"Convolve the image with the specified kernel.","k":"convolve specified kernel","l":"/api-operation#convolve"},{"t":"threshold","d":"Any pixel value greater than or equal to the threshold value will be set to 255, otherwise it will be set to 0.","k":"threshold pixel greater than equal otherwise","l":"/api-operation#threshold"},{"t":"boolean","d":"Perform a bitwise boolean operation with operand image.","k":"boolean bitwise operation operand","l":"/api-operation#boolean"},{"t":"linear","d":"Apply the linear formula a input b to the image levels adjustment","k":"linear apply formula input levels adjustment","l":"/api-operation#linear"},{"t":"recomb","d":"Recomb the image with the specified matrix.","k":"recomb specified matrix","l":"/api-operation#recomb"},{"t":"modulate","d":"Transforms the image using brightness, saturation and hue rotation.","k":"modulate transforms brightness saturation hue rotation","l":"/api-operation#modulate"},{"t":"removeAlpha","d":"Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel.","k":"removealpha remove alpha channel","l":"/api-channel#removealpha"},{"t":"ensureAlpha","d":"Ensure the output image has an alpha transparency channel. If missing, the added alpha channel will have the specified transparency level, defaulting to fully-opaque 1. This is a n","k":"ensurealpha output alpha transparency channel missing added specified level defaulting fully opaque","l":"/api-channel#ensurealpha"},{"t":"extractChannel","d":"Extract a single channel from a multi-channel image.","k":"extractchannel extract single channel multi","l":"/api-channel#extractchannel"},{"t":"joinChannel","d":"Join one or more channels to the image. The meaning of the added channels depends on the output colourspace, set with toColourspace. By default the output image will be web-friendl","k":"joinchannel join one channels meaning added depends output colourspace tocolourspace web friendl","l":"/api-channel#joinchannel"},{"t":"bandbool","d":"Perform a bitwise boolean operation on all input image channels bands to produce a single channel output image.","k":"bandbool bitwise boolean operation input channels bands produce single channel output","l":"/api-channel#bandbool"},{"t":"tint","d":"Tint the image using the provided chroma while preserving the image luminance. An alpha channel may be present and will be unchanged by the operation.","k":"tint chroma preserving luminance alpha channel present unchanged operation","l":"/api-colour#tint"},{"t":"greyscale","d":"Convert to 8-bit greyscale 256 shades of grey. This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use gamma with greyscale for the best re","k":"greyscale convert bit shades grey linear operation input colour space srgb gamma best","l":"/api-colour#greyscale"},{"t":"grayscale","d":"Alternative spelling of greyscale.","k":"grayscale greyscale","l":"/api-colour#grayscale"},{"t":"toColourspace","d":"Set the output colourspace. By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.","k":"tocolourspace output colourspace web friendly srgb additional channels interpreted alpha","l":"/api-colour#tocolourspace"},{"t":"toColorspace","d":"Alternative spelling of toColourspace.","k":"tocolorspace tocolourspace","l":"/api-colour#tocolorspace"},{"t":"format","d":"An Object containing nested boolean values representing the available input and output formats/methods.","k":"format object nested boolean representing available input output formats methods","l":"/api-utility#format"},{"t":"interpolators","d":"An Object containing the available interpolators and their proper values","k":"interpolators object available proper","l":"/api-utility#interpolators"},{"t":"versions","d":"An Object containing the version numbers of libvips and its dependencies.","k":"versions object version numbers libvips dependencies","l":"/api-utility#versions"},{"t":"cache","d":"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. This method always retur","k":"cache limits libvips operation existing entries trimmed change method retur","l":"/api-utility#cache"},{"t":"concurrency","d":"Gets or, when a concurrency is provided, sets the number of threads _libvips_ should create to process each image.","k":"concurrency number threads libvips create process","l":"/api-utility#concurrency"},{"t":"queue","d":"An EventEmitter that emits a change event when a task is either","k":"queue eventemitter emits change event task","l":"/api-utility#queue"},{"t":"counters","d":"Provides access to internal task counters.","k":"counters provides access internal task","l":"/api-utility#counters"},{"t":"simd","d":"Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with liborc support.","k":"simd vector unit instructions requires libvips compiled liborc","l":"/api-utility#simd"}] \ No newline at end of file +[{"t":"Prerequisites","d":"Node.js v10","k":"prerequisites node","l":"/install#prerequisites"},{"t":"Prebuilt binaries","d":"Ready-compiled sharp and libvips binaries are provided for use with Node.js v10 on the most common platforms macOS x64 10.13 Linux x64 glibc 2.17, musl 1.1.24 Linux ARM64 glibc 2.2","k":"prebuilt binaries compiled sharp libvips node common platforms macos linux glibc musl arm","l":"/install#prebuilt-binaries"},{"t":"Common problems","d":"The architecture and platform of Node.js used for npm install must be the same as the architecture and platform of Node.js used at runtime. When using npm v6 or earlier, the npm in","k":"common problems architecture platform node npm install runtime earlier","l":"/install#common-problems"},{"t":"Apple M1","d":"Prebuilt libvips binaries are provided for macOS on ARM64 since sharp v0.28.0. During npm install sharp will be built locally, which requires Xcode and Python - see building from s","k":"apple prebuilt libvips binaries macos arm sharp during npm install built locally requires xcode python building","l":"/install#apple-m1"},{"t":"Custom libvips","d":"To use a custom, globally-installed version of libvips instead of the provided binaries, make sure it is at least the version listed under config.libvips in the package.json file a","k":"custom libvips globally installed version instead binaries make listed config package json file","l":"/install#custom-libvips"},{"t":"Building from source","d":"This module will be compiled from source at npm install time when a globally-installed libvips is detected set the SHARP_IGNORE_GLOBAL_LIBVIPS environment variable to skip this, pr","k":"building source module compiled npm install time globally installed libvips detected environment variable skip","l":"/install#building-from-source"},{"t":"Custom prebuilt binaries","d":"This is an advanced approach that most people will not require. To install the prebuilt sharp binaries from a custom URL, set the sharp_binary_host npm config option or the npm_con","k":"custom prebuilt binaries advanced approach people require install sharp url npm config option npmcon","l":"/install#custom-prebuilt-binaries"},{"t":"Chinese mirror","d":"A mirror site based in China, provided by Alibaba, contains binaries for both sharp and libvips. To use this either set the following configuration sh npm config set sharp_binary_h","k":"chinese mirror site china alibaba contains binaries sharp libvips following configuration npm config sharpbinaryh","l":"/install#chinese-mirror"},{"t":"FreeBSD","d":"The vips package must be installed before npm install is run. sh pkg install -y pkgconf vips sh cd /usr/ports/graphics/vips/ make install clean","k":"freebsd vips package installed npm install run pkg pkgconf usr ports graphics make clean","l":"/install#freebsd"},{"t":"Linux memory allocator","d":"The default memory allocator on most glibc-based Linux systems e.g. Debian, Red Hat is unsuitable for long-running, multi-threaded processes that involve lots of small memory alloc","k":"linux memory allocator glibc systems debian red hat unsuitable long running multi threaded processes small alloc","l":"/install#linux-memory-allocator"},{"t":"Heroku","d":"Add the jemalloc buildpack to reduce the effects of memory fragmentation. Set NODE_MODULES_CACHE","k":"heroku add jemalloc buildpack reduce effects memory fragmentation","l":"/install#heroku"},{"t":"AWS Lambda","d":"The binaries in the node_modules directory of the deployment package must be for the Linux x64 platform. When building your deployment package on machines other than Linux x64 glib","k":"aws lambda binaries nodemodules directory deployment package linux platform building your machines other than glib","l":"/install#aws-lambda"},{"t":"Webpack","d":"Ensure sharp is added to the externals configuration. js externals sharp commonjs sharp","k":"webpack sharp added externals configuration commonjs","l":"/install#webpack"},{"t":"Worker threads","d":"The main thread must call requiresharp before worker threads are created to ensure shared libraries remain loaded in memory until after all threads are complete.","k":"worker threads main thread requiresharp created shared libraries remain loaded memory complete","l":"/install#worker-threads"},{"t":"Canvas and Windows","d":"The prebuilt binaries provided by canvas for Windows depend on the unmaintained GTK 2, last updated in 2011. These conflict with the modern, up-to-date binaries provided by sharp.","k":"canvas windows prebuilt binaries depend unmaintained gtk last updated conflict modern date sharp","l":"/install#canvas-and-windows"},{"t":"Sharp","d":"Constructor factory to create an instance of sharp, to which further methods are chained.","k":"sharp constructor factory create instance further methods chained","l":"/api-constructor#sharp"},{"t":"clone","d":"Take a snapshot of the Sharp instance, returning a new instance. Cloned instances inherit the input of their parent instance. This allows multiple output Streams and therefore mult","k":"clone snapshot sharp instance returning new cloned instances inherit input parent multiple output streams mult","l":"/api-constructor#clone"},{"t":"metadata","d":"Fast access to uncached image metadata without decoding any compressed image data. A Promise is returned when callback is not provided.","k":"metadata fast access uncached decoding compressed data promise returned callback","l":"/api-input#metadata"},{"t":"stats","d":"Access to pixel-derived image statistics for every channel in the image. A Promise is returned when callback is not provided.","k":"stats access pixel derived statistics channel promise returned callback","l":"/api-input#stats"},{"t":"toFile","d":"Write output image data to a file.","k":"tofile write output data file","l":"/api-output#tofile"},{"t":"toBuffer","d":"Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF and raw pixel data output are supported.","k":"tobuffer write output buffer jpeg png webp avif tiff raw pixel data","l":"/api-output#tobuffer"},{"t":"withMetadata","d":"Include all metadata EXIF, XMP, IPTC from the input image in the output image. This will also convert to and add a web-friendly sRGB ICC profile unless a custom output profile is p","k":"withmetadata include metadata exif xmp iptc input output convert add web friendly srgb icc profile custom","l":"/api-output#withmetadata"},{"t":"toFormat","d":"Force output to a given format.","k":"toformat force output format","l":"/api-output#toformat"},{"t":"jpeg","d":"Use these JPEG options for output image.","k":"jpeg output","l":"/api-output#jpeg"},{"t":"png","d":"Use these PNG options for output image.","k":"png output","l":"/api-output#png"},{"t":"webp","d":"Use these WebP options for output image.","k":"webp output","l":"/api-output#webp"},{"t":"gif","d":"Use these GIF options for output image.","k":"gif output","l":"/api-output#gif"},{"t":"tiff","d":"Use these TIFF options for output image.","k":"tiff output","l":"/api-output#tiff"},{"t":"avif","d":"Use these AVIF options for output image.","k":"avif output","l":"/api-output#avif"},{"t":"heif","d":"Use these HEIF options for output image.","k":"heif output","l":"/api-output#heif"},{"t":"raw","d":"Force output to be raw, uncompressed, 8-bit unsigned integer unit8 pixel data. Pixel ordering is left-to-right, top-to-bottom, without padding. Channel ordering will be RGB or RGBA","k":"raw force output uncompressed bit unsigned integer unit pixel data ordering left right top bottom padding channel rgb rgba","l":"/api-output#raw"},{"t":"tile","d":"Use tile-based deep zoom image pyramid output. Set the format and options for tile images via the toFormat, jpeg, png or webp functions. Use a .zip or .szi file extension with toFi","k":"tile deep zoom pyramid output format images via toformat jpeg png webp functions zip szi file extension tofi","l":"/api-output#tile"},{"t":"resize","d":"Resize image to width, height or width x height.","k":"resize width height","l":"/api-resize#resize"},{"t":"extend","d":"Extends/pads the edges of the image with the provided background colour. This operation will always occur after resizing and extraction, if any.","k":"extend extends pads edges background colour operation resizing extraction","l":"/api-resize#extend"},{"t":"extract","d":"Extract/crop a region of the image.","k":"extract crop region","l":"/api-resize#extract"},{"t":"trim","d":"Trim boring pixels from all edges that contain values similar to the top-left pixel. Images consisting entirely of a single colour will calculate boring using the alpha channel, if","k":"trim boring pixels edges contain similar top left pixel images consisting entirely single colour calculate alpha channel","l":"/api-resize#trim"},{"t":"composite","d":"Composite images over the processed resized, extracted etc. image.","k":"composite images processed resized extracted","l":"/api-composite#composite"},{"t":"rotate","d":"Rotate the output image by either an explicit angle or auto-orient based on the EXIF Orientation tag.","k":"rotate output explicit angle auto orient exif orientation tag","l":"/api-operation#rotate"},{"t":"flip","d":"Flip the image about the vertical Y axis. This always occurs after rotation, if any. The use of flip implies the removal of the EXIF Orientation tag, if any.","k":"flip vertical axis rotation implies removal exif orientation tag","l":"/api-operation#flip"},{"t":"flop","d":"Flop the image about the horizontal X axis. This always occurs after rotation, if any. The use of flop implies the removal of the EXIF Orientation tag, if any.","k":"flop horizontal axis rotation implies removal exif orientation tag","l":"/api-operation#flop"},{"t":"affine","d":"Perform an affine transform on an image. This operation will always occur after resizing, extraction and rotation, if any.","k":"affine transform operation resizing extraction rotation","l":"/api-operation#affine"},{"t":"sharpen","d":"Sharpen the image. When used without parameters, performs a fast, mild sharpen of the output image. When a sigma is provided, performs a slower, more accurate sharpen of the L chan","k":"sharpen parameters fast mild output sigma slower accurate chan","l":"/api-operation#sharpen"},{"t":"median","d":"Apply median filter. When used without parameters the default window is 3x3.","k":"median apply filter parameters window","l":"/api-operation#median"},{"t":"blur","d":"Blur the image. When used without parameters, performs a fast, mild blur of the output image. When a sigma is provided, performs a slower, more accurate Gaussian blur.","k":"blur parameters fast mild output sigma slower accurate gaussian","l":"/api-operation#blur"},{"t":"flatten","d":"Merge alpha transparency channel, if any, with a background, then remove the alpha channel.","k":"flatten merge alpha transparency channel background then remove","l":"/api-operation#flatten"},{"t":"gamma","d":"Apply a gamma correction by reducing the encoding darken pre-resize at a factor of 1/gamma then increasing the encoding brighten post-resize at a factor of gamma. This can improve","k":"gamma apply correction reducing encoding darken pre resize factor then increasing brighten post improve","l":"/api-operation#gamma"},{"t":"negate","d":"Produce the negative of the image.","k":"negate produce negative","l":"/api-operation#negate"},{"t":"normalise","d":"Enhance output image contrast by stretching its luminance to cover the full dynamic range.","k":"normalise enhance output contrast stretching luminance cover full dynamic range","l":"/api-operation#normalise"},{"t":"normalize","d":"Alternative spelling of normalise.","k":"normalize normalise","l":"/api-operation#normalize"},{"t":"convolve","d":"Convolve the image with the specified kernel.","k":"convolve specified kernel","l":"/api-operation#convolve"},{"t":"threshold","d":"Any pixel value greater than or equal to the threshold value will be set to 255, otherwise it will be set to 0.","k":"threshold pixel greater than equal otherwise","l":"/api-operation#threshold"},{"t":"boolean","d":"Perform a bitwise boolean operation with operand image.","k":"boolean bitwise operation operand","l":"/api-operation#boolean"},{"t":"linear","d":"Apply the linear formula a input b to the image levels adjustment","k":"linear apply formula input levels adjustment","l":"/api-operation#linear"},{"t":"recomb","d":"Recomb the image with the specified matrix.","k":"recomb specified matrix","l":"/api-operation#recomb"},{"t":"modulate","d":"Transforms the image using brightness, saturation and hue rotation.","k":"modulate transforms brightness saturation hue rotation","l":"/api-operation#modulate"},{"t":"removeAlpha","d":"Remove alpha channel, if any. This is a no-op if the image does not have an alpha channel.","k":"removealpha remove alpha channel","l":"/api-channel#removealpha"},{"t":"ensureAlpha","d":"Ensure the output image has an alpha transparency channel. If missing, the added alpha channel will have the specified transparency level, defaulting to fully-opaque 1. This is a n","k":"ensurealpha output alpha transparency channel missing added specified level defaulting fully opaque","l":"/api-channel#ensurealpha"},{"t":"extractChannel","d":"Extract a single channel from a multi-channel image.","k":"extractchannel extract single channel multi","l":"/api-channel#extractchannel"},{"t":"joinChannel","d":"Join one or more channels to the image. The meaning of the added channels depends on the output colourspace, set with toColourspace. By default the output image will be web-friendl","k":"joinchannel join one channels meaning added depends output colourspace tocolourspace web friendl","l":"/api-channel#joinchannel"},{"t":"bandbool","d":"Perform a bitwise boolean operation on all input image channels bands to produce a single channel output image.","k":"bandbool bitwise boolean operation input channels bands produce single channel output","l":"/api-channel#bandbool"},{"t":"tint","d":"Tint the image using the provided chroma while preserving the image luminance. An alpha channel may be present and will be unchanged by the operation.","k":"tint chroma preserving luminance alpha channel present unchanged operation","l":"/api-colour#tint"},{"t":"greyscale","d":"Convert to 8-bit greyscale 256 shades of grey. This is a linear operation. If the input image is in a non-linear colour space such as sRGB, use gamma with greyscale for the best re","k":"greyscale convert bit shades grey linear operation input colour space srgb gamma best","l":"/api-colour#greyscale"},{"t":"grayscale","d":"Alternative spelling of greyscale.","k":"grayscale greyscale","l":"/api-colour#grayscale"},{"t":"toColourspace","d":"Set the output colourspace. By default output image will be web-friendly sRGB, with additional channels interpreted as alpha channels.","k":"tocolourspace output colourspace web friendly srgb additional channels interpreted alpha","l":"/api-colour#tocolourspace"},{"t":"toColorspace","d":"Alternative spelling of toColourspace.","k":"tocolorspace tocolourspace","l":"/api-colour#tocolorspace"},{"t":"format","d":"An Object containing nested boolean values representing the available input and output formats/methods.","k":"format object nested boolean representing available input output formats methods","l":"/api-utility#format"},{"t":"interpolators","d":"An Object containing the available interpolators and their proper values","k":"interpolators object available proper","l":"/api-utility#interpolators"},{"t":"versions","d":"An Object containing the version numbers of libvips and its dependencies.","k":"versions object version numbers libvips dependencies","l":"/api-utility#versions"},{"t":"cache","d":"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. This method always returns","k":"cache limits libvips operation existing entries trimmed change method returns","l":"/api-utility#cache"},{"t":"concurrency","d":"Gets or, when a concurrency is provided, sets the number of threads libvips should create to process each image.","k":"concurrency number threads libvips create process","l":"/api-utility#concurrency"},{"t":"queue","d":"An EventEmitter that emits a change event when a task is either","k":"queue eventemitter emits change event task","l":"/api-utility#queue"},{"t":"counters","d":"Provides access to internal task counters.","k":"counters provides access internal task","l":"/api-utility#counters"},{"t":"simd","d":"Get and set use of SIMD vector unit instructions. Requires libvips to have been compiled with liborc support.","k":"simd vector unit instructions requires libvips compiled liborc","l":"/api-utility#simd"}] \ No newline at end of file diff --git a/package.json b/package.json index 9ccc3837..9558c930 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "color": "^3.1.3", "detect-libc": "^1.0.3", "node-addon-api": "^3.1.0", - "prebuild-install": "^6.1.1", + "prebuild-install": "^6.1.2", "semver": "^7.3.5", "simple-get": "^3.1.0", "tar-fs": "^2.1.1", @@ -131,12 +131,12 @@ "async": "^3.2.0", "cc": "^3.0.1", "decompress-zip": "^0.3.3", - "documentation": "^13.2.1", + "documentation": "^13.2.5", "exif-reader": "^1.0.3", "icc": "^2.0.0", "license-checker": "^25.0.1", "mocha": "^8.3.2", - "mock-fs": "^4.13.0", + "mock-fs": "^4.14.0", "nyc": "^15.1.0", "prebuild": "^10.0.1", "rimraf": "^3.0.2",