Discussion:
[krita] [Bug 397346] New: Color-to-Alpha filter mask range seems to give wrong results
(too old to reply)
Alex
2018-08-10 14:20:47 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

Bug ID: 397346
Summary: Color-to-Alpha filter mask range seems to give wrong
results
Product: krita
Version: nightly build (please specify the git hash!)
Platform: Other
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: Filter Layers
Assignee: krita-bugs-***@kde.org
Reporter: ***@gmail.com
Target Milestone: ---

Created attachment 114393
--> https://bugs.kde.org/attachment.cgi?id=114393&action=edit
color-to-alpha range on gradient and black background

Please take a look at attached screen. Left is original white to black
gradient. Center right is gradient with Color to Alpha set to black and range
255. Right is Color to Alpha set to white and range only 100. I'm not sure
about this, but center example should be perfect black and right one with some
white gradient visible.

Kra file attached.
Nightly build git: 9d313ac
--
You are receiving this mail because:
You are watching all bug changes.
Alex
2018-08-10 14:21:20 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

--- Comment #1 from Alex <***@gmail.com> ---
Created attachment 114394
--> https://bugs.kde.org/attachment.cgi?id=114394&action=edit
color-to-alpha sample kra file
--
You are receiving this mail because:
You are watching all bug changes.
Eoin O'Neill
2018-09-16 00:02:05 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

Eoin O'Neill <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEEDSINFO
Resolution|--- |WAITINGFORINFO
CC| |***@gmail.com

--- Comment #2 from Eoin O'Neill <***@gmail.com> ---
Application Version: MASTER
Needs More Info (And Feedback)

Perhaps I'm misunderstanding this feature, but it seems to me to be working as
intended.

Lets talk about the left most filter first. You have black set to 255 which
eats away most (but not all of) the white. I think this makes some degree of
sense due to the limitation of the the bar itself, and not the logic. Perhaps
it could be argued that the value should go from 0 > 257 for a full range
(where 0 would keep ALL data and 257 would remove all data) but I don't believe
that technically means it is a bug -- but I could be wrong and would like to
see others input on this.

Now for the second example, this seems to be working fine with the caveat that
the brightness on screen does not necessarily equate to brightness of values in
actuality. If you set the value to something like 80, you get more what you
are expecting (a little bit of white sandwiched between two blacks.)

I could be wrong about some of this though.
--
You are receiving this mail because:
You are watching all bug changes.
Eoin O'Neill
2018-09-16 00:02:28 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

Eoin O'Neill <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Keywords| |investigated, triaged
--
You are receiving this mail because:
You are watching all bug changes.
Alex
2018-09-16 07:28:10 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

--- Comment #3 from Alex <***@gmail.com> ---
Created attachment 114994
--> https://bugs.kde.org/attachment.cgi?id=114994&action=edit
color-to-alpha sample kra file updated

I've updated file to cover full range and left some white and black bar
visible. I've also added reversed gradient from white to black (not from
transparent to white as previous one) just in case.

I think bug is this 100 value, that's limiting effect for black and is "enough"
for white. If you pick grey that you get from left sample you will get exact
100, like effect is limited to only 100.

Reversed situation is visible on right gradient: if you use only 100 value you
remove all of white (logic tells me you should put 255 to get all of white
removed).

Question here now: why you can remove all of white with only 100 value set and
only get grey value of 100 trying to remove all of black (0 value)? Why you
can't remove all of white and get black?

For me it's like scale of slider is set in values 0-255 and effect is in
percent 0-100 or something like this.
--
You are receiving this mail because:
You are watching all bug changes.
Eoin O'Neill
2018-09-16 23:49:49 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

Eoin O'Neill <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Status|NEEDSINFO |CONFIRMED
Resolution|WAITINGFORINFO |---

--- Comment #4 from Eoin O'Neill <***@gmail.com> ---
Application Version: Master
CONFIRMED

Yes, there's definitely some inconsistency in behavior here that needs to be
addressed. That second file cleared things up for me, so thanks.
--
You are receiving this mail because:
You are watching all bug changes.
Dmitry Kazakov
2018-09-17 10:24:26 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

Dmitry Kazakov <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WAITINGFORINFO
Status|CONFIRMED |NEEDSINFO
CC| |***@gmail.com

--- Comment #5 from Dmitry Kazakov <***@gmail.com> ---
Hi, Alex!

There are several points I should make clear before making any real decision
about the bug:

1) The 'threshold' value in this filter is not directly linked to RGB values.
It is actually CIELAB deltaE (CIE76) value, normalized to a 0...255 range. So I
would not try to make any assumptions on its numerical values. Just 0 removes
nothing, 100 removes the selected color only, 255 is the value that removes
almost everything. The values in between are just interpolation of this
behavior :)

2) In the second version of your file, there is a bug, 'Filter Mask 2' of 'Copy
of Layer 1' removes black color instead of white. Therefore it gives
inconsistent behavior with the other mask. If you change the color of 'Filter
Mask 2' to white then they start behave quite consistently.

3) I don't actually understand what the problem is? Do you mean that value 255
doesn't hide everything?


https://en.wikipedia.org/wiki/Color_difference#CIE76
--
You are receiving this mail because:
You are watching all bug changes.
Dmitry Kazakov
2018-09-17 10:26:12 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

--- Comment #6 from Dmitry Kazakov <***@gmail.com> ---
Created attachment 115034
--> https://bugs.kde.org/attachment.cgi?id=115034&action=edit
Test file for removing black and white

Here is a test file that tries to remove black and white from a gradiant. As
far as I can tell, the filter works quite logically in both cases.
--
You are receiving this mail because:
You are watching all bug changes.
Alex
2018-09-17 12:31:35 UTC
Permalink
https://bugs.kde.org/show_bug.cgi?id=397346

--- Comment #7 from Alex <***@gmail.com> ---
Created attachment 115035
--> https://bugs.kde.org/attachment.cgi?id=115035&action=edit
color-to-alpha sample kra file on black and white background

@Dmitry: Thank you!
I wasn't aware that 100 removes color only and it also seems like my testing
methodology has flaw: I need to test against black and white background not
only black. Indeed I thought that 255 is removing actual color.
I'm here very, very sorry for my beta-tester inconvenience!

Two things noticed in the meantime (second not related):
- removing white with thr. 100 on white background will not give exact same
result as source gradient, this is minor difference though (visible on upper
gradient and a little bit on lower in blacks range)
- invert filter seems not to give same result on gradient, I'm not sure if it
should (hidden invert test filter layer) but checked in PS and "inverted"
gradient is ok there
--
You are receiving this mail because:
You are watching all bug changes.
Loading...