mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Improve docs relating to single-channel raw pixel output
This commit is contained in:
@@ -168,5 +168,19 @@ describe('Raw pixel data', function () {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('extract A from RGBA', () =>
|
||||
sharp(fixtures.inputPngWithTransparency)
|
||||
.resize(32, 24)
|
||||
.extractChannel(3)
|
||||
.toColourspace('b-w')
|
||||
.raw()
|
||||
.toBuffer({ resolveWithObject: true })
|
||||
.then(({ info }) => {
|
||||
assert.strictEqual('raw', info.format);
|
||||
assert.strictEqual(1, info.channels);
|
||||
assert.strictEqual(32 * 24, info.size);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user