Closed ton11797 closed 1 month ago
This is a scenario that matrix multiplication via the recomb operation should allow but currently it only supports a 3x3 matrix for non-alpha channels.
Let's tag this as an enhancement for 4x4 matrix support.
// Proposed API to support 4x4 matrix - NOT YET AVAILABLE
const alphaMultiplication = 1.1;
const output = await sharp(input)
.recomb([
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, alphaMultiplication
])
.toBuffer();
v0.33.5 now available, thank you for implementing this feature.
Question about an existing feature
What are you trying to achieve?
I want to multiply the Alpha channel with an opacity value. This is what I came up with in my code
Question
Are there any more efficient or simplified methods to achieve this using the Sharp library?