An additional feature for AI masking?

I am finding the AI object masking extremely useful but…

While it gets the mask right most of the time, just occasionally if fails to do so. I then have to revert to drawing the mask manually.

I don’t know whether it would be possible, but I wonder if an option to refine a manual mask would be feasible.

4 Likes

Like drawing a rough mask manually and having AI improve it? That sounds interesting and I support that idea … but in my humble opinion I fear it’s a lot more complicated that what’s been implemented so far. I would like to be proven wrong tho.

2 Likes

So do I, hence me raising it here rather than going straight to a feature request.

From a high-level perspective, I can see two ways how this could work.

  1. create an draw mask, create the ai mask ( just from the whole image) and take the intersection of those two. There is hardly any new functionality needed for this, actually I think you can already try this is the current darktable version or else with the new masking features that likely will hit 5.8.

  2. or, somehow the AI masking is only run on the part of that selected by the draw mask. This seems hard, because wha pixels to you fed the masking process? As an easier intermediate solution we might fed the bounding box of the drawn mask…

I still think that the best way to use ai mask is to use refinements to get the transition right.

  1. Draw Ai mask
  2. Shrink a bit
  3. Increase refinements feathering
  4. Play with refinements opacity/contrast until happy
2 Likes

There are three ways to refine AI object mask:

  • while creating mask by multiple clicks on the object;
  • after mask is created by adjusting resulting path shape;
  • use mask refinement as @Masterpiga just described (though shrinking is not always required, but helps sometimes).
1 Like

In my experience this is mostly a theoretical option. In practice I find it fiddly and unworkable. Just because it is a vector and not a bitmap.