After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775653 - Most of blending modes are not correctly implemented
Most of blending modes are not correctly implemented
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-12-05 18:02 UTC by Thomas Manni
Modified: 2017-02-02 21:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xcf file to illustrate blending modes issue (2.96 MB, image/x-xcf)
2016-12-05 18:02 UTC, Thomas Manni
Details
Comparison between original and modified compositing for the overlay blending mode (130.99 KB, image/jpeg)
2016-12-09 08:36 UTC, Thomas Manni
Details

Description Thomas Manni 2016-12-05 18:02:56 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).
Comment 1 Jehan 2016-12-09 02:54:12 UTC
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?
Comment 2 Michael Schumacher 2016-12-09 08:13:17 UTC
This bug is the result of a discussion on #gimp.
Comment 3 Thomas Manni 2016-12-09 08:36:06 UTC
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...
Comment 4 Michael Natterer 2017-02-02 21:36:10 UTC
This is fixed by the recent layer mode explosion in master, the
old stuff is in the "legacy" category now for eternal compatibility.