GNOME Bugzilla – Bug 775653
Most of blending modes are not correctly implemented
Last modified: 2017-02-02 21:36:10 UTC
Created attachment 341417 [details] xcf file to illustrate blending modes issue It seems that the compositing equation implemented in most of the blending modes is wrong. The attached xcf file illustrates the problem for the overlay blending mode : observe how semi-transparent pixels on the 'circle' layer (at the border of the circle) are rendered differently than the opaque pixels. Switching to Darken only, Multiply, Burn, Soft Light, Hard Light, Grain Merge and Value (HSV) blend modes on the 'lights' layer show the same behavior. With the 'lights' and 'black' layers inverted, switching to Lighten only, Screen, Dodge, Addition and Difference blend modes on the 'lights' layer show the same behavior. The precision of the image is not involved in this bug : integer or float, linear light or perceptual gamma, the problem is still visible. After studing the porter duff blending/compositing equations described here https://www.w3.org/TR/2013/WD-compositing-1-20130625 (chapters 6 and 9.1), I think the problem come from the use of the pre-multipled alpha color result directly to the output (which explain why the bug is visible only for semi-transparent pixels).
I don't really know what we are supposed to see on your test image. When I look the semi-transparent pixels, they look "ok" to me (like, I don't see the obvious issue you seem to point). But then I am not an expert on all these composition modes. Do you have any reference to show what we are supposed to see instead?
This bug is the result of a discussion on #gimp.
Created attachment 341662 [details] Comparison between original and modified compositing for the overlay blending mode (In reply to Jehan from comment #1) > I don't really know what we are supposed to see on your test image. When I > look the semi-transparent pixels, they look "ok" to me (like, I don't see > the obvious issue you seem to point). But then I am not an expert on all > these composition modes. > > Do you have any reference to show what we are supposed to see instead? I am not an expert too, but see this new attached image, the issue seems obvious ; I let you guess where is the current version and the modified version of the composite...
This is fixed by the recent layer mode explosion in master, the old stuff is in the "legacy" category now for eternal compatibility.