| Summary: | The display of Semi-transparent selection shifts too much after Inverting selection | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Tyson Tan <tysontanx> |
| Component: | Tools/Selection | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | halla, tamtamy.tymona |
| Priority: | NOR | ||
| Version First Reported In: | 5.2.9 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Invert selection outline display shifts demo document | ||
Remove triaged keyword from CONFIRMED bugs So what's happening here is that Krita selects all pixels that aren't 100% transparent ("Select Opaque"). When the selection is inverted, it means Krita selects all pixels that that aren't 100% opaque. The selection outline reflects this correctly, because semi-transparent pixels are being selected. (Recent improvements to the Fill Tool also made it behave more correctly and reflect this fact.)
I understand what Tyson Tan is after here though, the expectation is that the selection is binary: either the pixel gets fully selected or not selected at all (save for some AA on the borders of the selection). This would definitely be convenient for drawing around something already on the layer/canvas. Perhaps an additional "Select Transparent" that only selects pixels that are completely transparent could be good?
I'm leaving this as confirmed for 5.2.9 even though it isn't technically a bug, but so that a developer can make a call.
I think the problem here is not what the selection is doing, because it's doing everything correctly. It selects the fully opaque pixels fully, doesn't select fully transparent pixels, and then partially selects the semi transparent pixels. What's wrong is that the selection outline is painted around every pixel that is at least semi-selected. That means that all semi-transparent pixels will be within the selection both before and after inverting it. To prevent this from happening, the outline should be painted around every pixel that is selected in at least 50% and not painted around pixels that are selected in less than 50%. I'm not sure if that's what artists would want, though. It means that plenty of things would be outside of the perceived outline even though they are at least partially selected. Maybe instead an option to make the selection binary (fully select all partially selected pixels, or fully deselect them) would help with Tyson's usecase? I believe artists prefer a binary outline that aligns with the edges of fully-opaque pixels adjacent to semi-transparent ones, rather than interpolating positions for semi-transparent pixels. We know from experience that painting software often selects additional semi-transparent pixels based on color-difference thresholds. As long as the selection outline is positioned at the boundary between fully-opaque and semi-transparent pixels, inverting a selection won't alter the outline. Krita's performance may improve slightly without the need for extra interpolation. This was how Photoshop functioned in CS3, as I recall. During those years, more thought was given to Photoshop's UX. Perhaps we can learn from their approach. I'm not sure I would like the selection to outline only appear around 100% or >50% opaque pixels while more is being selected. It seems even more confusing to me. The border of the selection is a useful indication of what pixels are being considered.
Imagine a case where a user has a layer full of only semi-transparent pixels, like an occlusion shadow pass or some subtle glow effects. If they used the "select opaque" action, chances are nothing would show and they might think the feature is broken. I've also personally used this feature to detect some stray patches of very transparent pixels that I wanted to erase.
> Maybe instead an option to make the selection binary (fully select all partially selected pixels, or fully deselect them) would help with Tyson's usecase?
This was sort of what I was getting at with the "Select transparent" idea, which would only select 100% transparent pixels and could be inverted to select every non-transparent pixel fully and thus cover all the bases. A checkbox/dialog for "preserve transparency" would also work. Another convoluted solution would be to make the selection outline also render a discrete screentone gradient that corresponds to the transparency of the selection, i suppose?
|
Created attachment 129300 [details] Invert selection outline display shifts demo document When a selection has semi-transparent pixels, its outline display shifts too much after inverting the selection. This is an issue relayed from the community. Using the attached demo document: 1) The colors in the demo has semi-transparent pixels around the edge. 2) Select Opaque 3) See how the selection outline is sitting right on the perceived edge 4) Invert Selection 5) See how the selection outline is now running around the pixels with no transparency. 6) Fill foreground color, the perceived actual filling area doesn't resemble the inverted outline at all. So the display of the outline moves a lot after inverting the selection, but the effective outline is pretty much unchanged. Tested with 4.3.0 beta 2.