Support composite op with non-sRGB pipeline colourspace (#4412)

This commit is contained in:
Kleis Auke Wolthuizen
2025-06-12 11:32:24 +02:00
committed by GitHub
parent 91f1b58f31
commit 4d1f7e051d
3 changed files with 27 additions and 4 deletions

View File

@@ -122,6 +122,26 @@ describe('composite', () => {
});
});
it('scrgb pipeline', () => {
const filename = 'composite-red-scrgb.png';
const actual = fixtures.path(`output.${filename}`);
const expected = fixtures.expected(filename);
return sharp({
create: {
width: 32, height: 32, channels: 4, background: red
}
})
.pipelineColourspace('scrgb')
.composite([{
input: fixtures.inputPngWithTransparency16bit,
blend: 'color-burn'
}])
.toFile(actual)
.then(() => {
fixtures.assertMaxColourDistance(actual, expected);
});
});
it('multiple', async () => {
const filename = 'composite-multiple.png';
const actual = fixtures.path(`output.${filename}`);