[RFC] [Builds available] Masking panel revamp and new masking possibilities

A new build may be available here shortly, if everything goes well.

Here are the changes.

UX

  • Moved editing controls inside the group list layout, to make it more obvious that they are connected.

  • Moved presets in their own menu, so that they are more discoverable.

  • Added three presets to imitate classic mask modes, plus a more advanced one for fun.

  • Added “preset notes”, which provide in-panel guidance for new users:

    • When you use a group preset, each group gets a set of cards (notes) that explain what it does and how to modify it to achieve different results. Longer notes are split into multiple pages.

    • Upon adding a preset, all the cards show at once. After you select something in the panel, only the card of the selected group shows. Individual cards can be hidden with the (i) icon in the group header. A settings option disables the notes for good.

  • Reflow controls on one, two or three lines, depending on panel size.



  • Renamed operators to focus on the what, rather than the how. The mathematical formulation is still available in the tooltip, and improved group icons to be more distinctive and descriptive.

  • Dropped the opacity controls in the element headers. Now the opacity is always shown in the properties, either under the element or in a separate collapsible, based on settings.

  • Added an explicit control for element visibility in the row headers. click toggles visibility, shift+click toggles solo mode.

  • Consolidated preferences (if present) and refinements panel in a new supanel, captioned with the currently selected element.

  • Added an option (true) by default to remember the last picked area and reuse it across parametric channel elements.

  • More visible and CSS-themable low-opacity (orange) and no-op (red) badges.

Cleanup

  • Dropped the opacity-themed slider, as it only made sense when it was used without a label and that use case is no more.

Fixes

5 Likes

I have nothing more to report for the time being, but wanted to say at this point I don’t know if to be more impressed by your dev skills, or your patience to keep refining this. But then again, seeing how critical masking is to image editing and how important strong masking is to darktable, this really should be fantastic when launches. So - just continuous props from me. Thank you!

2 Likes

Thanks, but credit goes where credit is due: all the heavy lifting is done by Claude and Gemini. I am just telling them what to do, and making sure they do it properly. It still takes a lot of time and iterations, don’t get me wrong, but each iteration takes hours instead of days or weeks, and I can let them work in the background while I work my day job. And no, I would have never had the stamina to embark on this journey if I had had to write all the code myself.

BTW, it took me and the agents one afternoon to implement the first working prorotype, and it’s taking many weeks to converge on a good UX and to squash the most obvious bugs.

5 Likes

Dumb question, do we need 3 union modes/2 overlap modes…

is the math that different that given we have all these controls…

that we can’t achieve a similar result…which could then also be saved as a preset …sort of the way there is a “smooth” preset for sigmoid…

Maybe I need to go back and look at the math but at first glance I am not sure this one is an improvement for me… the rest is great and I might be the only one that has this initial impression looking at the new functional vs mathmatical interaction modes…

As I said …potentially “dumb”… :slight_smile:

1 Like

Short answer is yes :slight_smile:

The three union modes are:

  • Sum
  • Max
  • Screen (smooth)

which produce very different results when feathered area are involved, which is almost always.

The lack of screen in classic has always been a major pain point for me. Have you ever tried stacking two gradients, to then realize that you cannot because you get ridges where they overlap? Screen fixes that.

And the two overlap modes are:

  • Min (intersection)
  • Multiply (which is what classic already uses to combine parametric channels among themselves and with shapes).

My question to the audience is which naming scheme do you prefer, the classic/math-y names or the new, more goal-oriented ones.

The controls have nothing to do with how different groups blend together. These are the very same controls that you already had in the mask manager, only in the same panel. If you didn’t use them before (as I never did) you can just collapse that panel and forget that it exists.

I was not a fan of the algebra. I think it’s fine to have it in a tooltop but not in the names themselves.

As for your new build, I like it a lot. The UI looks much cleaner, more defined and with some useful features (love the option to “reuse last picked area”, thanks!).

  • Presets: While “classic” might mean something to seasoned users, it doesn’t really describe what will happen.
    Maybe add the operator, so that it’s clearer what the preset will do in its default state. For example:
    “drawn (union)”
    “parametric (overlap)”
    “drawn (union) + parametric (overlap)”
    etc.

  • If you don’t use presets and just start clicking on tools, can the “Whole mask” default to union for drawn shapes and overlap for parametric? This would just be based on what you click first. I think that would be consistent with the classic masking workflow.

  • I still find drawn objects too hard to see, and it’s still hard to find resize nodes. I don’t think we need to be too subtle with these shapes. There is the option to hide them, so when they’re visible, can we make sure they’re really visible?

Great work, Daniele!

I find the classic names better. It’s consistent with the rest of darktable UI. Even when you referenced them in your last post, you use min, max, multiply, etc. I find it way clearer than smooth, strongest, added, etc.

I guess my testing was extremely limited but I did the classic…draw some overlapping circles to create overlaps and intersection areas and I turned on the overlay. I could see some difference when I toggle the modes but in only looking that way it really seemed very very similar just the edges were more or less diffuse which I felt I could achieve with the refinement code…

Getting a really good visual on an image that demonstrates those modes might be nice rather than trying to rely on the mask overview to show what is the nature of the different modes…

Since you brought up gradients…I feel like the mask interaction between a gradient and a drawn shape is not correctly showing in the mask overlay…setting it to exclude or subtract, and esp when you widen out the gradient, you have to be almost approaching the bottom of the gradient before the interaction starts to show, ie you need to be close to or past the transition to full opacity for the gradient…I think that a gradient would appear in the drawn shape or should much sooner but again maybe this a me not following the program… :slight_smile:
To reproduce draw a shape outside the gradient boundary then slowly drag it further into the gradient…to me it seems like you need to be very far in to the gradient to start to see the expected interaction start to appear… again could just be me…

EDIT

Classic presets are a nice feature and should really help ease people in…nice work on that. I have been testing it in its own panel since I have a large monitor and this I think will be my preferred way to use it… I just need to now go back and wrap my head around how to use the compose feature and I think I have it mostly sorted…thanks

With regards to math terms vs friendly ones I think it’s important to consider the conventions outside of just this module and even darktable itself. For instance there are blending modes called difference both in darktable and gimp, etc.

1 Like

If there is one correct unambiguous term like multiply, I’d suggest using that. If two terms are both correct–difference and subtract, min and intersect–I’d suggest using the one that is most consistent with other tools. Inventing names like “stronger” makes me wary because the respective operation is a new concept to memorize, and it won’t be applicable to any other graphics tool. (But simple language words are great in parentheses or a tooltip, as an explanation.)

I get that the non-math people don’t like us using math terms to describe editor functions. I’m sorry. And we have covered similar ground in other threads. It seems like when there’s exactly one correct way to describe an operation, it’s least alienating to use that correct name.

4 Likes

I don’t mind, so long as it doesn’t go too far beyond ordinary vocabulary or too much conceptual learning to even use the word. Or slider: Hello D&S!

I was thrown out of the maths class at 15. Another 15 years later, I found myself sat in front of a computer, getting on rather well with Unix. It also so happened that I frequently found myself having to do edits on data where stuff went wrong. Search for pattern, do something. Yes, I got on rather well with grep and the suite of unix text processing commands.

Did I mention that I’m not a mathematician? To this day, I don’t really know what regular expression means in maths — but that didn’t stop me getting quite good at them :slight_smile:

Bottom line is that some things have a lingo. I’ve sailed yachts; I’ve made jewellery. Both those activities have a whole heap of terminology. One learns it.

So I support, in dt masking, using the “right” words. And documentation, tooltips, explanatory blogs, videos etc can give us those “simple language words … … … as an explanation.”

2 Likes

That is also not really a term in mathematics, but in computer science :wink:

1 Like

Honestly, I did give up trying to use the Flexi panel about 10 days ago. And I did begin study about ART. A couple of days ago, I got advice to re-try the latest build, and try presets built-in. Thankfully, I can easily apply the preset “drawn + parametric (classic)”. Zero % failure. However, I am still having hard time to apply “drawn + parametric, minus an area (advanced) preset”.

I would appreciate it if you elaborate the real use case adopting advanced preset.

One question that I need to clarify: In the past, I can see the COLORED parametric channel preview when I press the C key with mouse hovered on the target channel. But I see a grayscale channel mask preview when I put my mouse over the targer channel without hitting C key. A COLORED parametric channel preview is available only after moving one of triangles even a bit. Is that normal behavior in Flexi?

Thank you always for your kind support.

I am very glad to hear that :slight_smile:

It is just an example, you don’t have to use it if you do not need it. As the name suggests, you can use that presets when you need to cut one or more holes in a drawn/parametric mask. If one shape is enough to describe the area that you want to subtract from, you do not need an extra group. You can just use d+p and set the operator of the drawn group to subtraction. The shapes on top will be cut off from the bottom one.

For example, here I have used circle to restrict the area affected by a parametric channel.

If I want to turn the circle into a donut shape, I can just change the operator of “drawn” to subtraction, so that whatever I add to the group is subtracted from the bottom element, and draw a smaller circle on top of the other. I will call it “hole”:

This also works if I want to cut off two holes, and not just one, e.g.:

However, if the shape that I want to subtract from is not a simple shape, but is the composition of multiple shapes, then you need one group to assemble the shape, and another group to subtract from it. For example, here I am subtracting a rectangle from the union of two circles:

If I disable the parametric channel, just to show the geometry of the shapes, it looks like this:

If I understand correctly, you are mixing two things: (a) the channel preview overlay and (b) the mask preview overlay.

(a) shows you how the pixels are distributed according to a specific parametric channel, e.g., Cz (saturation). In classic, you showed that by pressing c while hovering the slider of a parametric channel. In flexi there is no c shortcut. Instead, there is an option in the preferences:

When this is enabled, hovering over any of the “add parametric channel” buttons will show the corresponding overlay, without having to press any key:

(b), instead, shows you how the mask looks like. Where something is masked, it shows a yellow overlay. Where nothing is masked, it shows a grayscale image. This is activated with the “show mask overlay” function:

This works the same way in classic as it did in flexi. The only difference is that in classic an empty mask (i.e., a mask that does nothing) would show (what I dearly refer to as) “a yellow wall”. This is very impractical, because if you want to draw something or use a parametric channel picker while the overlay is on, then you cannot see where you are drawing, or where you are picking from. Therefore in flexi I changed this, and the mask overlay shows that something is masked ONLY if something is actually masked. If nothing is masked, you will just see the grayscale image. That’s why you see the yellow bits appearing only after you move the sliders: you only see the masked area after something is actively masked.

I hope this clarifies your doubts.

1 Like

I recomfirmed whether “preview channel under cursor” in the panel settings is still enabled. Yes, it is still enabled. And then I put my mouse over the “Cz”, but I still see non-colored channel preview as before.

Sorry to interrupt you, but I need to ask you about stable version(v5.6.1) vs nightly build(5.7.0+1301).

I did remove darktable 5.6.1 completely this morning, and then installed the 5.7.0+1301 version as if it were an official release. It was installed in C\Program Files\darktable folder, not in the name of “darktable-dev”. The location of configuration directory was designated to be the same one for the official release. Again, I treated the version 5.7.0+1301 as being an official release. The reason for doing this was because I like to use Flexi panel & “contrast & texture” module. And I did test Flexi panel all the morning, and I made success every time only with “drawn+parametric (classic)” preset as I reported already.

For lunch, I quit the darktable. After lunch, I re-launched it, but I had to see the different darktable reset from the one customized by me including preferences settings.

Is there any way for me to keep using 5.7.0+1301 version until 5.8 is officially available? Of course, there will no other darktable versions but 5.7.0+1301 to avoid potential conflicts.

Thank you in advance.

You really shouldn’t use the builds that I provide for anything other than testing.

I just started a new build, which should complete shortly.

The only change, other than a bunch of small fixes and the usual master sync, is that I renamed the operators based on some of the feedback that I received. Now it’s like this:

which I think is the best of both worlds:

  • It still tells you what they are for (e.g., union vs. intersection)
  • But it also communicates more clearly what the operators do mathematically

Other than that, with this I consider that the feature is in a good enough state to be upstreamed, and I will promptly start the process to break it into polished PRs to be merged into master.

Thanks a lot to you all for your invaluable feedback, for your support during the development process and for the time that you spent testing this feature :heart:

9 Likes

Wow. Thanks a lot indeed!!! :slight_smile: