Krita - Remove Selection Holes

It would be nice to have a “Remove Holes” action like GIMP’s. The use case is really broad, but to exemplify, I can use a example present on the Krita Docs Stroke Selection Page:

The page is a tutorial on making an automatic outline to artworks, but there’s this artifact (marked in green, which could have been done on purpose by the tutorial author), caused by a gap/hole in the selection. This kind of thing is easily solvable by having a “Remove holes” feature, which would just include the gap as part of the selection.

You can see a little more examples here:

Photoshop doesn’t have this feature, but you can mimic it using macros, in a slightly worse way. The step by step of the macro can be done on Krita as well, but we don’t have macros, so it’s very inconvenient.

Hi. Check out the Enclose and Fill Tool.

Example settings if you don’t want to fill on a separate layer:

1 Like

Oh, using this tool makes things different, but it’s not that much more convenient than doing the Photoshop step-by-step, because of needing to reconfigure things in a way or another.

0 - Create selection with potential holes
1 - Select your “Global Selection Mask” (which may or may not be activated)
2 - Configure your “Enclose and Fill Tool” which may be misconfigured
3 - Change your color to white
4 - Manually select the whole page or the section with the selection
X - Return to your layer, change your color back, maybe reconfigure “Enclose and Fill Tool” and maybe deactivate “Global Selection Mask” (if’s according to your tastes)

Photoshop (Can be fully automatized with macros, and set up with a hotkey):
0 - Create selection with potential holes
1 - Create temporary layer
2 - Use the selection to create a opaque patch of any color
3 - Do a “Contiguous Selection Tool” on extreme coordinates (upper-left or bottom-right for example)
4 - Invert Selection
5 - Delete the temporary layer
X - maybe reconfigure “Contiguous Selection Tool”

If I’m not missing anything, not using “Enclose and Fill Tool” is actually easier, when dealing with selections, of course.

I see.
(For the Stroke Selection example image one would want to keep some of the holes however. :slight_smile: )

Maybe it’s possible to write a python script that automates this?

I think it’d be better to discuss this over at

1 Like

I’m pretty sure it is, I didn’t explore this side of krita yet.

You’re absolutely right. I didn’t know most of Krita was there, the Contributors Manual in the docs is pretty dense, specially the Features Proposal page.

1 Like