darktable-org / darktable-org/darktable

Port Fuzzy Selection from GIMP as a mask creation tool, alternative to AI

Open
#20,538 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

no-issue-activity
Dominant language
C
Stars
13.1k
Forks
1.4k
Avg merge
22h 14m
Merged PRs (30d)
198

Description

Is your feature request related to a problem? Please describe.

Modern editing workflows in other image editors depend on precise, ideally pixel-perfect, object masks. AI models such as SAM2.1 are the primary solution proposed (see #20322), but the AI topic is very polarizing. Some people do not accept the current AI models on ethical grounds but still deserve pixel-perfect object masks, even when current parametric masks are insufficient.

Describe the solution you'd like

GIMP already has a non-AI tool for this exact purpose: Fuzzy Selection. And it performs similarly well to SAM 2.1, or in many cases (e.g., bird feathers) significantly better, with just a bit more clicking required. Hence, here is the request for porting it.

Demo in GIMP: https://discuss.pixls.us/t/for-something-different-sky-selection/56371/12

Alternatives

Continue creating non-AI masks with GIMP as an external tool, or surrender to the AI process.

Disclaimer: I am a user of AI masks with ART, but at this point, I sometimes prefer GIMP's fuzzy selection on the grounds of better quality of the resulting mask, and I would like AI opponents to have a viable alternative to AI masks anyhow.

Additional context

The AI mask merge request already contains the infrastructure for selecting a set of points that define the input for producing a mask, and that's almost exactly what Fuzzy Selection needs. Almost, because there are extra parameters associated with each point, like the "Threshold" slider and the "Select by: [Composite, Red, Green, Blue, ...]" choice box. In addition, it is often required to remove holes from the resulting mask, so an interface for doing so should also be provided. It may also be a good idea to offer an option to run the fuzzy selection tool on a slightly blurred image so that the fine texture is ignored.

@andriiryzhkov @TurboGit To be clear, this does not nullify your work on adding AI-based masking to DT. We need both ways of creating object-based masks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the AI mask merge request and its existing infrastructure for selecting input points, then compare the requested behavior with the linked GIMP Fuzzy Selection demo. The work is complete when darktable can create masks from selected points with threshold and channel options, support removing holes, and provide the requested blurred-image option if adopted.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.