Bug 416892 - Contiguous Selection Tool behavior
Summary: Contiguous Selection Tool behavior
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR minor
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-29 05:55 UTC by acc4commissions
Modified: 2020-06-12 18:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
describing the problem (101.83 KB, image/png)
2020-01-29 05:55 UTC, acc4commissions
Details

Note You need to log in before you can comment on or make changes to this bug.
Description acc4commissions 2020-01-29 05:55:37 UTC
Created attachment 125509 [details]
describing the problem

SUMMARY
In short : Contiguous Selection Tool doesn't work as expected when I try to select transparent pixels. Changing settings(fuziness, etc) makes 0 differences in the output.

The best way the test this is : 

1. Create 2 layers with color gradients, and merge one of them with a white 100% layer.
2. Select Contiguous Selection Tool, and check 'Limit to Current Layer' in Tool Settings.
3. Try to select any area in the gradient on both layers. 

It would select different areas, 
and changing settings on the layer that has transparent background, won't make any difference on the area that it selects.



SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

Similar problem happens with Similar Color Selection Tool too.
Comment 1 acc4commissions 2020-01-29 06:01:47 UTC
The most pesky problem is that I can't ignore very light and pale pixels by changing the fuzziness. When I click the transparent area of the layer, the detection seems to become binary, and it only select pixels that is 'completely' transparent.
Comment 2 Ahab Greybeard 2020-01-29 17:28:12 UTC
I can confirm this for the Jan 28th 4.3.0 prealpha appimage git(049dd11)

The contiguous selection tool and the similar colour selection tool both do a binary (alpha equals 0  or alpha not equal to 0) selection with a gradient on a transparent background.

For the contiguous selection tool, a workaround for this is to put a contrasting solid colour layer under the gradient-on-transparent layer and then use the tool with limit to current layer turned off.

That workaround does not work for the similar colour selector tool. You have to merge a copy of the gradient with a contrasting filled layer and use it on that to get a selection that is correct and controllable.

There have been other previous concerns about how pixels with alpha less than 1 are treated so this may be one of those situations.
Comment 3 Dmitry Kazakov 2020-06-12 18:15:04 UTC
Git commit 0e28b2a36ba79805330c0f66d1bf5058a437ddf2 by Dmitry Kazakov.
Committed on 12/06/2020 at 18:14.
Pushed by dkazakov into branch 'krita/4.3'.

Fix KoColorSpace::differenceA() handle fully transparent pixels properly

If the pixel is fully transparent, then it is treated as if its color
channels would be the same as ones of the other pixel. It fixes the
problem of calculating threshold of flood fill tools.

M  +2    -2    libs/image/floodfill/kis_scanline_fill.cpp
M  +7    -0    libs/pigment/KoColorSpace.h
M  +4    -1    plugins/color/lcms2engine/LcmsColorSpace.h

https://invent.kde.org/graphics/krita/commit/0e28b2a36ba79805330c0f66d1bf5058a437ddf2
Comment 4 Dmitry Kazakov 2020-06-12 18:15:20 UTC
Git commit 733a9480fbdc0c334407d8184f09d251485c17ca by Dmitry Kazakov.
Committed on 12/06/2020 at 18:15.
Pushed by dkazakov into branch 'master'.

Fix KoColorSpace::differenceA() handle fully transparent pixels properly

If the pixel is fully transparent, then it is treated as if its color
channels would be the same as ones of the other pixel. It fixes the
problem of calculating threshold of flood fill tools.

M  +2    -2    libs/image/floodfill/kis_scanline_fill.cpp
M  +7    -0    libs/pigment/KoColorSpace.h
M  +4    -1    plugins/color/lcms2engine/LcmsColorSpace.h

https://invent.kde.org/graphics/krita/commit/733a9480fbdc0c334407d8184f09d251485c17ca