@@ -63,6 +63,10 @@ function rotate (angle, options) {
6363/**
6464 * Flip the image about the vertical Y axis. This always occurs after rotation, if any.
6565 * The use of `flip` implies the removal of the EXIF `Orientation` tag, if any.
66+ *
67+ * @example
68+ * const output = await sharp(input).flip().toBuffer();
69+ *
6670 * @param {Boolean } [flip=true]
6771 * @returns {Sharp }
6872 */
@@ -74,6 +78,10 @@ function flip (flip) {
7478/**
7579 * Flop the image about the horizontal X axis. This always occurs after rotation, if any.
7680 * The use of `flop` implies the removal of the EXIF `Orientation` tag, if any.
81+ *
82+ * @example
83+ * const output = await sharp(input).flop().toBuffer();
84+ *
7785 * @param {Boolean } [flop=true]
7886 * @returns {Sharp }
7987 */
@@ -291,6 +299,13 @@ function sharpen (options) {
291299/**
292300 * Apply median filter.
293301 * When used without parameters the default window is 3x3.
302+ *
303+ * @example
304+ * const output = await sharp(input).median().toBuffer();
305+ *
306+ * @example
307+ * const output = await sharp(input).median(5).toBuffer();
308+ *
294309 * @param {number } [size=3] square mask size: size x size
295310 * @returns {Sharp }
296311 * @throws {Error } Invalid parameters
@@ -421,6 +436,10 @@ function negate (options) {
421436
422437/**
423438 * Enhance output image contrast by stretching its luminance to cover the full dynamic range.
439+ *
440+ * @example
441+ * const output = await sharp(input).normalise().toBuffer();
442+ *
424443 * @param {Boolean } [normalise=true]
425444 * @returns {Sharp }
426445 */
@@ -431,6 +450,10 @@ function normalise (normalise) {
431450
432451/**
433452 * Alternative spelling of normalise.
453+ *
454+ * @example
455+ * const output = await sharp(input).normalize().toBuffer();
456+ *
434457 * @param {Boolean } [normalize=true]
435458 * @returns {Sharp }
436459 */
@@ -446,6 +469,14 @@ function normalize (normalize) {
446469 *
447470 * @since 0.28.3
448471 *
472+ * @example
473+ * const output = await sharp(input)
474+ * .clahe({
475+ * width: 3,
476+ * height: 3,
477+ * })
478+ * .toBuffer();
479+ *
449480 * @param {Object } options
450481 * @param {number } options.width - integer width of the region in pixels.
451482 * @param {number } options.height - integer height of the region in pixels.
@@ -655,28 +686,38 @@ function recomb (inputMatrix) {
655686 * @since 0.22.1
656687 *
657688 * @example
658- * sharp(input)
689+ * // increase brightness by a factor of 2
690+ * const output = await sharp(input)
659691 * .modulate({
660- * brightness: 2 // increase brightness by a factor of 2
661- * });
692+ * brightness: 2
693+ * })
694+ * .toBuffer();
662695 *
663- * sharp(input)
696+ * @example
697+ * // hue-rotate by 180 degrees
698+ * const output = await sharp(input)
664699 * .modulate({
665- * hue: 180 // hue-rotate by 180 degrees
666- * });
700+ * hue: 180
701+ * })
702+ * .toBuffer();
667703 *
668- * sharp(input)
704+ * @example
705+ * // increase lightness by +50
706+ * const output = await sharp(input)
669707 * .modulate({
670- * lightness: 50 // increase lightness by +50
671- * });
708+ * lightness: 50
709+ * })
710+ * .toBuffer();
672711 *
712+ * @example
673713 * // decreate brightness and saturation while also hue-rotating by 90 degrees
674- * sharp(input)
714+ * const output = await sharp(input)
675715 * .modulate({
676716 * brightness: 0.5,
677717 * saturation: 0.5,
678- * hue: 90
679- * });
718+ * hue: 90,
719+ * })
720+ * .toBuffer();
680721 *
681722 * @param {Object } [options]
682723 * @param {number } [options.brightness] Brightness multiplier
0 commit comments