Bug 294493 - about the behaviour of the opacity layers when flattening
Summary: about the behaviour of the opacity layers when flattening
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 2.4-snapshots
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-20 12:05 UTC by Philippe Nicloux
Modified: 2012-02-23 11:56 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
layer opacity problem (686.39 KB, image/jpeg)
2012-02-22 15:42 UTC, Philippe Nicloux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Nicloux 2012-02-20 12:05:36 UTC
Version:           2.4-snapshots (using KDE 4.8.0) 
OS:                Linux

When you flatten layers, if the opacity of the UPPER layer is SUPERIOR to the opacity of the LOWER layer, the resulting layer has the LOWER layer opacity value, and you can't sse what was the lower, and what was the upper drawing ( no good for sketching ).
If the UPPER layer opacity value is INFERIOR to the LOWER layer opacity value, then it's ok, the resulting layer is a mix of the two layers, and you can distinguish was were the previous two drawings.

Reproducible: Always

Steps to Reproduce:
1- add a layer, sketch on it. put it to 50% opacity
2- add a layer, sketch a more detailed sketch.
3- flatten. 

Actual Results:  
Krita has put the two layer together with the same opacity value ( the lower layer one ), you can't distinguish anymore the detailed sketch from the first sketch.

Expected Results:  
krita should have flatten the layers with their distinctive opacity values, so, on the resulting layer, we should see the lower one more erased than the upper one.
and the resulting layer should be automatically put at 100% opacity.

OS: Linux (x86_64) release 3.0.0-16-generic
Compiler: gcc
Comment 1 Halla Rempt 2012-02-22 14:28:36 UTC
Hi Philippe,

I'm not actually completely sure I can follow you... Could perhaps attach some images to show the problem and the correct way of compositing?
Comment 2 Philippe Nicloux 2012-02-22 15:05:04 UTC
Le 22/02/2012 15:28, boud@valdyas.org a écrit :
> https://bugs.kde.org/show_bug.cgi?id=294493
>
>
> boud@valdyas.org changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |boud@valdyas.org
>
>
>
>
> --- Comment #1 from<boud valdyas org>   2012-02-22 14:28:36 ---
> Hi Philippe,
>
> I'm not actually completely sure I can follow you... Could perhaps attach some
> images to show the problem and the correct way of compositing?
>
Hi Boud,
Yes, i thought it should be complicated to explain. Here is a picture.
Comment 3 Halla Rempt 2012-02-22 15:36:27 UTC
Er, you have to go to the bug and attach it -- bugzilla isn't smart enough to attach an email attachment to the bug :-)
Comment 4 Philippe Nicloux 2012-02-22 15:41:35 UTC
Le 22/02/2012 16:36, boud@valdyas.org a écrit :
> https://bugs.kde.org/show_bug.cgi?id=294493
>
>
>
>
>
> --- Comment #3 from<boud valdyas org>   2012-02-22 15:36:27 ---
> Er, you have to go to the bug and attach it -- bugzilla isn't smart enough to
> attach an email attachment to the bug :-)
>
silly me !
Comment 5 Philippe Nicloux 2012-02-22 15:42:54 UTC
Created attachment 69008 [details]
layer opacity problem
Comment 6 Dmitry Kazakov 2012-02-23 11:16:32 UTC
Nice example! =)

Probably, you used "Merge Layer With Layer Below", not "Flatten Image"? I cannot reproduce this behavior with "Flatten Image".

Even if Philippe used "Merge Layer With Layer Below", this bug is still valid, because the Gimp works exactly as described. Our implementation just merges one layer into another, while it should create a new node when layers' properties do not coincide.
Comment 7 Halla Rempt 2012-02-23 11:48:07 UTC
I've got a fix I'll push tonight.
Comment 8 Halla Rempt 2012-02-23 11:56:11 UTC
Git commit 1dfec3c60478c642d92afb6e2acabd646f0a2345 by Boudewijn Rempt.
Committed on 23/02/2012 at 12:14.
Pushed by rempt into branch 'master'.

Correctly merge two layers

We need to merge both layers using the right properties on a third
paint device and then use that for the combined layer.

M  +33   -13   krita/image/kis_image.cc

http://commits.kde.org/calligra/1dfec3c60478c642d92afb6e2acabd646f0a2345