From 638d540371f2808c519e6a7d9f23c31392dd7e80 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 18 Jan 2022 10:29:10 +0000 Subject: [PATCH] Docs: mild blur is a box filter, add examples --- lib/operation.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/operation.js b/lib/operation.js index 0dc37bd7..9e1e041c 100644 --- a/lib/operation.js +++ b/lib/operation.js @@ -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