Compare commits

..

2 Commits

Author SHA1 Message Date
Lovell Fuller
8607ff2f4a Tests: remove extraneous use of toColourspace 2025-08-18 10:33:32 +01:00
Lovell Fuller
cd337e4de3 Docs: extractChannel output colourspace is b-w or grey16 2025-08-18 10:24:55 +01:00
3 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,8 @@ const rgba = await sharp(rgb)
Extract a single channel from a multi-channel image.
The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit).
**Throws**:

View File

@ -74,6 +74,8 @@ function ensureAlpha (alpha) {
/**
* Extract a single channel from a multi-channel image.
*
* The output colourspace will be either `b-w` (8-bit) or `grey16` (16-bit).
*
* @example
* // green.jpg is a greyscale image containing the green channel of the input
* await sharp(input)

View File

@ -82,7 +82,6 @@ describe('Image channel extraction', function () {
const output = fixtures.path('output.extract-alpha-2-channel.png');
sharp(fixtures.inputPngWithGreyAlpha)
.extractChannel('alpha')
.toColourspace('b-w')
.toFile(output, function (err, info) {
if (err) throw err;
assert.strictEqual(1, info.channels);