Prevent double unpremultiply with some composite blends
@ -4,6 +4,11 @@
|
||||
|
||||
Requires libvips v8.12.2
|
||||
|
||||
### v0.30.3 - TBD
|
||||
|
||||
* Prevent double unpremultiply with some composite blend modes (regression in 0.30.2).
|
||||
[#3118](https://github.com/lovell/sharp/issues/3118)
|
||||
|
||||
### v0.30.2 - 2nd March 2022
|
||||
|
||||
* Improve performance and accuracy when compositing multiple images.
|
||||
|
@ -354,7 +354,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
||||
}
|
||||
|
||||
bool const shouldPremultiplyAlpha = sharp::HasAlpha(image) &&
|
||||
(shouldResize || shouldBlur || shouldConv || shouldSharpen || shouldComposite);
|
||||
(shouldResize || shouldBlur || shouldConv || shouldSharpen);
|
||||
|
||||
// Premultiply image alpha channel before all transformations to avoid
|
||||
// dark fringing around bright pixels
|
||||
|
BIN
test/fixtures/expected/composite-multiple.png
vendored
Before Width: | Height: | Size: 320 B After Width: | Height: | Size: 320 B |
BIN
test/fixtures/expected/composite.blend.dest-over.png
vendored
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 292 B |
BIN
test/fixtures/expected/composite.blend.over.png
vendored
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
BIN
test/fixtures/expected/composite.blend.saturate.png
vendored
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 286 B |
BIN
test/fixtures/expected/composite.blend.xor.png
vendored
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 285 B |
@ -158,6 +158,6 @@ describe('Extend', function () {
|
||||
})
|
||||
.raw()
|
||||
.toBuffer();
|
||||
assert.deepStrictEqual(Array.from(data), [191, 25, 65, 204, 238, 31, 82, 204]);
|
||||
assert.deepStrictEqual(Array.from(data), [191, 25, 66, 204, 191, 25, 66, 204]);
|
||||
});
|
||||
});
|
||||
|