Docs: mild blur is a box filter, add examples

This commit is contained in:
Lovell Fuller 2022-01-18 10:29:10 +00:00
parent d8f1298511
commit 638d540371

View File

@ -245,8 +245,21 @@ function median (size) {
/**
* Blur the image.
* When used without parameters, performs a fast, mild blur of the output image.
*
* When used without parameters, performs a fast 3x3 box blur (equivalent to a box linear filter).
*
* When a `sigma` is provided, performs a slower, more accurate Gaussian blur.
*
* @example
* const boxBlurred = await sharp(input)
* .blur()
* .toBuffer();
*
* @example
* const gaussianBlurred = await sharp(input)
* .blur(5)
* .toBuffer();
*
* @param {number} [sigma] a value between 0.3 and 1000 representing the sigma of the Gaussian mask, where `sigma = 1 + radius / 2`.
* @returns {Sharp}
* @throws {Error} Invalid parameters