Improve docs relating to single-channel raw pixel output

This commit is contained in:
Lovell Fuller
2020-03-01 14:22:49 +00:00
parent 03dad5f2b2
commit 258c9e86eb
7 changed files with 51 additions and 8 deletions

View File

@@ -54,9 +54,10 @@ function ensureAlpha () {
* @example
* sharp(input)
* .extractChannel('green')
* .toFile('input_green.jpg', function(err, info) {
* .toColourspace('b-w')
* .toFile('green.jpg', function(err, info) {
* // info.channels === 1
* // input_green.jpg contains the green channel of the input image
* // green.jpg is a greyscale image containing the green channel of the input
* });
*
* @param {Number|String} channel - zero-indexed band number to extract, or `red`, `green` or `blue` as alternative to `0`, `1` or `2` respectively.