Before I get started on implementing foreground extraction selection algorithm, I would love for artists to tell me how would they like to use it

Even though there was a phabricator for foreground selection at one point, I feel that it is time for me to discuss with artists on how they plan to use foreground selection. Now, some people may comment that this is photographic editing tool rather than a painting tool, but allow me to justify the existence of foreground selection for Krita.

  1. It would enable more options in terms of painting as it enables people to work with photographs to create artistic composition, and paint with photographs and a lot of brushes. This means that photo-matting in Krita could actually be a very real option.

  2. Sometimes, when dealing with flattened image, there may be some point where you are forced to try to extract a object. So, it enables streamlining in painting in situations like this.

  3. Non-destructive editing indirectly gets a boost on this by filtering only by the foreground extracted selected mask.

With all of this said, I would like to refer people to look at GIMP’s foreground extraction tool since that is theoretically the most feasible manner of foreground extraction. For reference, I will share this template (Icon doesn’t show up on my end, but I will have to speak to Krita team about that later, but it shows how it might look like). And yes, what you see in the template is the current progress of guided selection disregarding icon on the left, basically just the interface.

Note: Filter Epsilon is a parameter used for guided selection ; Radius is basically convolution kernel radius used for guided selection.

  1. On the GIMP side of thing, you paint between foreground, unknown, and background. Only the unknown area are modified. Is 3 areas are fine or would you prefer binary? The former is more accurate and much “less natural”, but the latter is less accurate but more “natural”.

2) With the Add, Replace, Remove… Does it make sense to enable recursive painting?
Note: I have decided to remove shape and mode selection. It’s not disabled yet, unfortunately from my end, but ignore this part.

  1. Finally, what if there was already a selection? Should the tool automatically create a guided selection after pressing enter?

Decided to update on this. Actually, I realized I may have to start over since shape operation modes needs to be removed. Here’s what I plan to create:

Note: Ignore the title please

If you have a selection active already, and have activate selection painting checked, and then click on generate selection, then, internally Krita will treat any selection value less than 1 and greater than 0 as a unknown variable. 0 is treated as background, 1 is treated as foreground, and .5 is treated as unknown. Also, if you don’t have a selection, you still will be able to paint selection.

If you have a selection active already, and don’t have activate selection painting checked, and then click on generate selection, then Krita will your current selection as a mask, and then return a extracted foreground selection.