Bug 322951 - JJ: "merge with layer below" should take the properties (inherit alpha, visibility) of the two layers into account
Summary: JJ: "merge with layer below" should take the properties (inherit alpha, visi...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layer Stack (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2013-07-29 14:48 UTC by Bollebib
Modified: 2014-02-16 10:13 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kra file showing a simple example of this bug (1.32 MB, application/zip)
2014-02-12 22:35 UTC, animtim
Details
latest patch for "merging the layer below" (1.40 KB, patch)
2014-02-16 09:56 UTC, Gaurav
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bollebib 2013-07-29 14:48:32 UTC
when you try to merge a layer with the layer below,and 1 of them is not 100% opaque krita wiill force the layer to be 100% opaque before merging resulting in unwanted behaviour.

flatten image does this correctly, it merges without changing the actual look of the image. Merge with layer below should mimick this ,I feel.
Comment 1 Halla Rempt 2013-07-29 14:53:34 UTC
Weird, I cannot reproduce that -- do you have a test file and before/after screenshots for us?
Comment 2 Bollebib 2013-07-29 14:57:35 UTC
I described the problem wrongly I found.

->it does not make the layer fully opaque,it actually removes it.


and after some more testing ,I discovered it's not the actual merging that creates the issue

apparently it happens when the layer below has "inherit alpha" active 

so krita should have a way to know the layer should not disappear when merging if inheret alpha is on.
Comment 3 Bollebib 2013-08-04 10:12:37 UTC
got an explanation about inheret alpha by animtim

I guess I was wrong and this feature works as intended


so a compromise was maybe there should be a warning somewhere. For the first time on screen
and for all the other times in the statusbar (for example) so that it doesn't bother you each time.


when merging the warning might say something like " warning, merging with inheret alpha layer on might result in unwanted results.

There might be other ways still,though.
Comment 4 Dmitry Kazakov 2013-08-08 19:17:10 UTC
Ok, confirm that we should ask a user whether he wants to merge layers with some special options active, e.g. inherit alpha, visibility, red/green/blue lock.

At the same time, if both the layers have the same properties, the resulting layer can inherit them. In such a case, we need *not* ask user about anything.

Now we just need to implement it.
Comment 5 Halla Rempt 2014-01-20 15:40:15 UTC
Git commit 3bb0178df73eb8cd6aca76a86819c613b7aef3db by Boudewijn Rempt.
Committed on 20/01/2014 at 15:38.
Pushed by rempt into branch 'calligra/2.8'.

Merging with a layer below with low opacity or with inherited alpha now
works fine in more situations.

Abnormal blending mode are still not working properly.

Merging a layer with inherit alpha on over a layer without this option
may still give too much pixels, that should be transparent.

Patch by Nicolas Brack. Thanks!

CCMAIL:nicolas.brack@mail.be

M  +21   -2    krita/image/kis_image.cc

http://commits.kde.org/calligra/3bb0178df73eb8cd6aca76a86819c613b7aef3db
Comment 6 Halla Rempt 2014-01-20 15:40:27 UTC
Git commit 61eed331e2e50d665b876a492d750c16e872e3b3 by Boudewijn Rempt.
Committed on 20/01/2014 at 15:38.
Pushed by rempt into branch 'master'.

Merging with a layer below with low opacity or with inherited alpha now
works fine in more situations.

Abnormal blending mode are still not working properly.

Merging a layer with inherit alpha on over a layer without this option
may still give too much pixels, that should be transparent.

Patch by Nicolas Brack. Thanks!

CCMAIL:nicolas.brack@mail.be

M  +21   -2    krita/image/kis_image.cc

http://commits.kde.org/calligra/61eed331e2e50d665b876a492d750c16e872e3b3
Comment 7 Halla Rempt 2014-01-22 14:32:55 UTC
There's still some todo here:

21.01.2014-11:54 < Animtim> boud: hey, what is exactly the patch about blending layer fixing? because before , merging an alpha-disabled layer on the layer under worked as it should, now it doesn't anymore :/
21.01.2014-11:55 < Animtim> and that's something I do often, so quite annoying
21.01.2014-12:00 < Animtim> hmm, it seems it makes merging an alpha-disabled layer on another alpha-disabled work better (though for this I used to re-activate alpha on those, merge, and then disable alpha on result).. but then it totally breaks merging alpha-disabled layer on normal layer, for which there is no workaround to get desired result now.
21.01.2014-12:01 < Animtim> so quite a regression to me
21.01.2014-12:10 < Animtim> (hum, there is actually a very ugly workaround to get correct result for merging alpha-disabled with normal layer, that is to put those in a new group, create empty layer below, and then merge the group layer to empty layer.. but that is really ugly workaround :.P )
Comment 8 animtim 2014-02-12 22:35:08 UTC
Created attachment 85119 [details]
kra file showing a simple example of this bug

Check the layers in the attached file to see the current problem.
Comment 9 Gaurav 2014-02-16 09:56:52 UTC
Created attachment 85174 [details]
latest patch for "merging the layer below"
Comment 10 Halla Rempt 2014-02-16 10:12:55 UTC
Git commit 94e1272fe30c64d5b0ae1615bc9c0e1317d653a3 by Boudewijn Rempt.
Committed on 16/02/2014 at 10:10.
Pushed by rempt into branch 'calligra/2.8'.

"Merge with layer below" should take the properties (inherit alpha,
visibility) of the two layers into account.

Patch by Gaurav Agrawal. Thanks!
CCMAIL:gauravagrawal03jan@gmail.com

M  +7    -2    krita/image/kis_image.cc

http://commits.kde.org/calligra/94e1272fe30c64d5b0ae1615bc9c0e1317d653a3
Comment 11 Halla Rempt 2014-02-16 10:13:29 UTC
Git commit 27ded1243745071c9f1158d0d3e9593de3a86089 by Boudewijn Rempt.
Committed on 16/02/2014 at 10:10.
Pushed by rempt into branch 'master'.

"Merge with layer below" should take the properties (inherit alpha,
visibility) of the two layers into account.

Patch by Gaurav Agrawal. Thanks!
CCMAIL:gauravagrawal03jan@gmail.com

M  +7    -2    krita/image/kis_image.cc

http://commits.kde.org/calligra/27ded1243745071c9f1158d0d3e9593de3a86089