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 767177 - Many Paintbrush modes can't paint over an erased area if the layer has an alpha channel.
Many Paintbrush modes can't paint over an erased area if the layer has an alp...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal enhancement
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-06-02 18:46 UTC by Elle Stone
Modified: 2017-02-15 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Comparison from GIMP to Krita > Painting with blend modes on transparent layers (48.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-01-15 13:29 UTC, jose americo gobbo
Details

Description Elle Stone 2016-06-02 18:46:30 UTC
Many Paintbrush modes can't paint over an erased area if the layer has an alpha channel. Here's how to produce the problem:

1. Make a new image with a solid white background. The Background layer doesn't have an alpha channel (if it does have an alpha channel, remove it).

2. Make a New Layer and make sure the New Layer *does* have an alpha channel.

3. Set the FG color to black, click on the Paintbrush, and select a parametric round brush.

4. Set the Paintbrush mode to Multiply.

5. Paint a solid black vertical swath through the middle of the new layer, leaving white on either side.

6. Change to the Eraser and erase the center of the black vertical swath painted in step 5.

7. Change back to the Paintbrush and try to paint horizontal black stripes across the vertical black swath with the erased center.

In Step 7, when using Multiply and many other Paintbrush modes, the brush can't paint across the portion of the layer that was erased in Step 6 .

Normal and a few other modes do allow to paint across the erased area.

Removing the alpha channel allows all of the Paintbrush modes to paint across the erased area.

Possibly related bugs (problems with painting on layers with alpha channels): 764552, 764619, 766116.
Comment 1 Elle Stone 2016-06-02 18:53:10 UTC
(In reply to Elle Stone from comment #0)

> 2. Make a New Layer and make sure the New Layer *does* have an alpha channel.

I forgot to say fill the New Layer with white, sorry!
Comment 2 Michael Schumacher 2016-06-03 06:55:32 UTC
If you write bug 764552, bug 764619, bug 766116 then they will be linked automatically.
Comment 3 Michael Natterer 2016-06-03 08:08:02 UTC
Where is the bug? If you e.g. multiply nothing the result is nothing...
Comment 4 Elle Stone 2016-06-03 11:19:21 UTC
(In reply to Michael Natterer from comment #3)
> Where is the bug? If you e.g. multiply nothing the result is nothing...

Well, I wasn't trying to multiply the zeroed out alpha channel by the painted color. I was trying to multiply the layer below the layer I was painting on by the painted color.

In Krita you can make a transparent paint layer and then paint on the transparent layer using Multiply. This provides a lot of flexibility.

Can the net result of the math of "alpha channel plus color painted on a transparent (portion or all of) layer" be modified such that one can paint on transparent areas using Paintbrush modes that involve multiplication?
Comment 5 Michael Schumacher 2016-06-03 12:06:08 UTC
Hm... sample merged compositing, so to speak...
Comment 6 Michael Natterer 2016-06-03 12:29:37 UTC
Um, are you sure you don't just want to set the layer mode to multiply?
Comment 7 Elle Stone 2016-06-03 13:28:24 UTC
(In reply to Michael Natterer from comment #6)
> Um, are you sure you don't just want to set the layer mode to multiply?

Quite sure. I've been painting at varying opacities with the brush in Multiply mode for radiometrically correct blending of the painted colors (requires using linear precision in default GIMP, and using a linear gamma RGB working space in my patched GIMP and in Krita).

Using Normal blend mode for the brush just replaces the old color with the new color, which is mathematically and visually quite different from multiplying the old color by the new color, even if the layer itself is set to Multiply blend mode. And of course setting the layer itself to Multiply blend mode does also affect the resulting color, making it darker than leaving a transparent layer at Normal blend mode and painting on the transparent layer using Multiply.
Comment 8 Massimo 2016-06-06 17:43:11 UTC
I've been asked to comment on this bug and not
being a digital painter, I dare to say:

I think this is not related to the bugs linked above.

IIUC, as Michael Schumacher said, it is a sample merged 
painting, put on the active transparent layer the result
of painting on the projection with the paint mode choosen.
As if the layer contained the projection.

But in my understanding this would be alternative to 
the current way of painting on a layer with alpha channel,
unless it can be proved that it would affect only cases
that today result in painting transparency.
Comment 9 Michael Natterer 2016-06-06 18:24:04 UTC
I agree with Massimo, this is simply a missing feature, and
probably quite easy to add.
Comment 10 Michael Natterer 2016-06-06 18:28:00 UTC
That said, I think it's a some-liner when the "Use GimpApplicator"
toggle is active. I'm not familiar enough with the default code path
to quickly judge the effort.
Comment 11 Elle Stone 2016-06-21 17:46:12 UTC
This bug report/enhancement request is actually about painting using various blend modes including Multiply on transparent layers. 

I had planned to file such an enhancement request and totally overlooked the fact that painting over an erased area was the same as painting on a transparent layers. Sorry for the confusion!

The ability to paint in various blend modes on a transparent layer is pretty important for many painting workflows. Krita does allow to do this.
Comment 12 jose americo gobbo 2017-01-15 13:29:07 UTC
Created attachment 343500 [details]
Comparison from GIMP to Krita > Painting with blend modes on transparent layers

The spreedsheet was made using the same blend modes between GIMP and Krita.
Comment 13 jose americo gobbo 2017-01-15 13:29:33 UTC
Some months ago I have made a comparison about this topic with Krita and Photoshop... only to question 'painting on transparent layers'.
The spreedsheet was made using the same blend modes between GIMP and Krita.

Is possible to verify this case in the current works around the blend modes to GIMP 2.9.6?
Comment 14 Elle Stone 2017-01-15 13:52:07 UTC
In case it might be useful, here's an older summary by a Krita dev regarding the difference between Krita GIMP, PhotoShop alpha handling: https://krita.org/en/item/krita-april-update/

This also might be relevant: https://docs.krita.org/Special:MyLanguage/Clipping_Masks_and_Alpha_Inheritance
Comment 15 Michael Natterer 2017-02-15 13:08:20 UTC
This got fixed recently, forgot the bug:

commit e1e41b86d0986ade760ae25d0e6378bd2c4763ae
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun Feb 5 23:08:16 2017 +0100

    app: allow painting on transparent layers with modes != normal
    
    by using GIMP_LAYER_COMPOSITE_SRC_OVER. Please test.

 app/paint/gimppaintcore-loops.c | 2 +-
 app/paint/gimppaintcore.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)