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

Thanks for your feedback, @sorceval. I will go through it with calm and see which of your suggestions I can incorporate.

But one thing, which is at the core of your whole proposal and probably invalidates most if not all of it, needs clarifying.

This is not possible, and indicates a lack of understanding of how masks (and especially parametric masks) work.

A parametric mask cannot be defined independently of a module. A parametric mask is a function defined over the input and the output of a module, plus a bunch of parameters. When you select a certain range of, say, exposure, you need to know at which point in the pipe you are measuring that level. Also raster masks are position dependent, because a module needs to compute and publish a mask before another module can use it.

The only masks that can be defined independently of modules are drawn ones. But then you would not want two completely differently workflows, one for drawn-only masks and one for everything else, right?

A lot of folks seem to have the idea that module-first masking (as opposed to mask-first masking) is just weird by design. It is not, it’s done like that for good reasons, the most notable one being that it’s extremely powerful and versatile. At the same time, it is not less generic, because whatever mask you define in any module can be rasterized and reused by other modules.

4 Likes

Thank you for your answer.

I understand that masks, especially parametric masks necessarily need a module to compute the range and their output.

I was more thinking of something like you only define the range of a parametric mask and then each module apply the range on its own input/output.

In example you have a blue range parametric mask from 50% to 100%:

Which means the mask resulting before and after a module like Exposure leads to a different mask. But the place where you control these parameters remains in a single place, the mask itself.

Anyway, I understand this cause more trouble, with the pipet tool for example, or with which step in the pipe is used to visualize the mask we are currently making. That makes sense, thank you for having spot this point.

Despite making masks independants from modules being impossible, I think it would be nice to have a place/list to visualize what masks are currently existing in our project (active or inactive), otherwise it would lead to situations like this one:

On where I tried different things and now I have a lot of “hidden and unused mask”, or maybe I didn’t find the right place to clean this?

Thanks!

A new build is brewing.

Main changes

UX

  • Improvements to panel collapsing behavior, such as:

    • Automatically collapse the mask panel when the focused module is collapsed.
    • Do not show the mask panel if the focused module has masking disabled.
    • Do not show the mask panel when the user peeks the mask using the icon on the module header.
  • Some improvements to the panel header, especially when hosted in a dedicated panel or as a utility module:

    • Added module and instance name to the mask panel header.
    • Improved alignment of the header items.
    • Pinning a floating panel automatically enables the mask.
    • The header is sticky.
    • The pin icon always align with the overlay icon, so tht you can hover and pin in just one gesture.
    • The background of the overlay icon is now transparent.
  • Added low-opacity badge also to the overall mask opacity slider.

  • Reduced spacing around parametric element sliders, replaced input/output text with icons to leave more space for sliders and added informative tooltips.

  • The tooltip of the mask overlay icon in a module’s header now summarizes the composition of the mask (number and type of elements).

  • Added option to temporarily disable all mask elements but retain overall mask opacity and blend mode. This was already available in classic but got lost somewhere along the way during the revamp.

  • More informative toast message when arming/unarming parametric mask element pickers.

  • Parametric per-channel overlays are now a panel option (“preview channel under cursor”) rather than a held key. Holding “c” was unreliable, because the key release is easily lost when it happens somewhere else in the UI:

    • Enable the option once from the panel options menu, then resting the pointer on one of the “add parametric element” buttons previews that channel on canvas.
    • The preview only starts after a short pause, so sweeping across the row of buttons on the way somewhere else does not queue up a reprocess per button.
    • Only the buttons preview. The sliders no longer do, so adjusting a range is never interrupted by an overlay you did not ask for. Nothing is lost, since the buttons are always visible.
  • “Solo edit” is now a mode instead of a per-element action, which is what makes it useful for inspecting a mask: enable it once from the elements header and it follows the list selection, so you can click down the list and isolate each shape in turn instead of triggering a separate action on each one. Its per-row badge and menu item are gone, as the header toggle and the selection highlight already say what it is doing.

  • Every entry in the panel options menu can now be assigned a keyboard shortcut, including the three that already existed (sticky opacity, auto-expand selected shape, collapse refinements by default).

  • The precise-entry popup of a parametric element slider now takes the channel’s own gradient, so it is colored like the track it is editing. On a hue channel it becomes the same color wheel that color balance rgb’s hue sliders open, which also means a control point can now be dragged past either end of the range and wrap around, as an angle should.

  • “Auto-expand selected shape” is now on by default: selecting a shape reveals its controls and collapses the previously selected one. It can still be turned off from the panel options menu.

Fixes

  • The masks panel was missing the “elements” section when opening classic uniform masks.

  • Shift+Click when arming the picker of a parametric element and then selecting on the canvas now correctly sets the range of the output slider (instead of the input range).

  • The precise-entry popup of a parametric element slider (right-click on a control point) no longer opens on the primary display when darktable is running on another monitor. It was positioning itself in screen coordinates while the popup machinery expected window-relative ones, which only ever agreed on a single-monitor setup with the window at the screen origin.

3 Likes

A lot of times when I use parametric masking, I will make a dummy module of null exposure below tone equalizer. After I use tone equalizer, it can be harder to isolate parts of the image by parameters. But I can re-use the raster mask from the null exposure earlier in the pipeline

1 Like

A new build is cooking.

EDIT: Updated link to point to a new build, the previous one had a stray settings icon when the panel was docked as a utility module, as also immortalized in the video.

Most of the work went into making the docked panel less cumbersome. When the panel is docked in the canvas, now it can seamlessly be shown on the left or the right. Also, the overlay icon has been replaced by an always present icon in the bottom toolbar (which also tells you if the mask of the focused module is on or off). You can toggle the panel on/off using this icon, or using hot canvas borders, as shown in the video below:

Modulo the cosmetic changes, I think it’s a huge usability improvement.

UX

Panel placement

  • The mask panel now has three places to live instead of four: inside each module (the default), in the utility module in the left panel, or in its own panel beside the canvas. There is no longer a separate “left” and “right” choice for that last one – it simply opens on whichever edge you open it from, and stays there. Your current setting carries over, side included.

  • The panel beside the canvas no longer shoves the image around. Showing or hiding it leaves your framing exactly where it was. It floats over the photo rather than taking a slice of the window, and you can still pan to anything underneath it.

  • Four ways to show and hide the panel when it is in a docked state, so you can reach it from wherever you already are:

    • the mask button at the far right of the bottom toolbar.

    • move the pointer to either edge of the canvas while the panel is away: a band appears with the mask icon and an arrow, and clicking it opens the panel on that edge:

      With the panel already open, the band on the opposite edge moves it across, so switching sides is one click rather than closing and reopening.

    • double-click the panel’s header to fold it away.

    • click the panel’s edge, where the drag-to-resize grip is. That grip is a little wider now and shows an arrow, since it does both jobs – drag it to resize, click it to hide.

    Please try all four and say which ones you actually end up using, and whether any of them fire when you did not mean them to.

  • The bottom toolbar’s mask button tells you two things at a glance: the icon is solid when the focused module has a mask and outlined when it does not. While the panel is expanded (regardless of its position), the button is framed and highlighted.

    Mask on, panel off:

    Mask on, panel on:

Settings

  • Right-click the mask button in the bottom toolbar for mask panel settings, same UX pattern used for guide settings.

Group layouts

  • Three new group layout presets ease the move from classic masks: “drawn mask” (a “shapes” group combining by screen), “parametric” (a “parametric” group combining by multiply), and “drawn + parametric” (the two, intersected). Layout presets now remember group names as well.

  • The group presets control has been removed from the mask panel preferences. Instead, they can be reached via right-click on the “add group” button. They build a whole set of groups in one go, so they live on the button they are a bulk version of.

Header

  • The panel header is down to the two controls that act on the mask: the overlay toggle and the on/off switch.

Fixes

  • Starting a shape and then clicking somewhere other than the canvas no longer leaves a stray half-added row in the mask panel, and no longer leaves the
    shape button stuck on. Pressing Escape or clicking away now cancels cleanly.
  • “show/hide mask panel” now works when the panel is in the utility module. It did nothing there before.

Looking forward to your feedback, happy testing!

6 Likes

That will trigger my considered purchase of a wider screen. :slightly_smiling_face:

This mask development is impressively thorough and takes the usability of dt two long strides forward – and just make me drool…

I’m very impressed and thankful by your efforts, Daniele!
If this doesn’t eventually make it to 5.8, it will be a BIG, BIG disappointment.

2 Likes

I absolutely agree with your compliment. I am really looking forward to seeing a new build for Windows.

1 Like

https://www.dropbox.com/scl/fi/lf92u2v9z8wcn9zl0807x/darktable-5.7.0-802-g7524c84751-win64-NSIS-deprecated.exe?rlkey=72app0bbajdgfhigyq5b0rwp5&st=cvss2vmv&dl=0

2 Likes

Thanks @don51.

The latest build is always available from the releases page:

Check the “Assets” section:

Among other things, the image not being knocked around is a huge improvement!

In the spirit of your previous second-screen endeavour: Option four - detached masking panel? It’d surely have it’s fans.

You mean, a floating panel?

Something that collapses to its header, with the header moving freely over the canvas and the panel unrolling under it whenever it is expanded?

Or a separate window altogether?

The latter. To enable putting the masking panel on a second screen.

It is relatively easy to do. However, I don’t think it would lead to a good UX. Mask editing is canvas heavy, you add shapes, move nodes and control points, go back to the module controls to adjust something, etc. The best place for the masking panel is (1) next to the canvas, and (2) adjacent to the processing module. Having the mask panel on another screen would require a lot of cursor movement. Already having the mask in the utility panel is unusable if you ask me.

After playing with flexi extensively, my opinion is that the panel docked on the canvas on the right is the best possible placement. All other options are far less usable. The “classic” option where you have to scroll up and down all the time to switch between module and mask controls is also not ergonomic at all, in comparison.

2 Likes

@mino An alternative that I was considering is a hybrid where the mask panel (when enabled) would occupy the bottom of the right panel, and you would be able to scroll the module AND the mask controls independently. That is, the panel would be split in two, the top part controlling the module, the bottom part controlling the mask. The divider would be not fixed of course, so you could decide how much space to allocate for module vs. mask. UX wise not as good as having the mask controls next to the module, but a nice improvement over the classic mode for those who want to maximize canvas space.

A new build is here.

UX

  • Do not show the on-canvas toggle mask panel overlay when a shape or control point is selected. This prevents the overlay from interfering with shape editing.

  • Add option to disable the resize handle of the docked panel to save some horizontal space. (@Pascal_Obry)

  • The mask panel now honors the “rounded corners” and “color accent” preferences.

  • Show a toast message when the panel reaches the maximum allowed width, instead of leaving the user wondering why the panel cannot be made larger.

  • Show descriptive tooltips for each within- and between-group operator in the mask panel.

GTK 4

@Arecsu @Pascal_Obry

  • Replaced gtk_box_* constructs with dt_gui_* ones.

  • Replaced all popup menus to use GtkPopover.

Fixes

@anry @Pascal_Obry

  • Fixed a bug in the migration code that could mess up the internal mask state when editing a previously migrated mask.

  • Reset mask elements in the panel immediately when the history is reset, instead of waiting for the mask to be enabled again.

  • Cleaned up some GTK errors.

1 Like

Is there a thread where you talk about how the invert options are supposed to work… I found the workflow a bit difficult to follow. Some selections were hidden as right-click options. In particular the invert all for elements didn’t seem to invert the slider displays and you had a highlight indicatort to left that did toggle. Right clicking work show an element as inverted in the drop down. If on the other hand you inverted elements individually the slider widget would invert… So you could have a visual state the was different but shown the same in the drop down menu…

I just found it a bit confusing…And for me if you invert elements either selectively one at a time or with the invert all elements option the widgets should toggle…

I just was playing around a little last night.

I’ll try to review your documents and if it’s still not clear I will try to lay this out in a logical order with some screenshots or aittle video…

I like the look and layout… A few greyed out things were hard to see on my gray theme and my monitor is a 32 inch and I could see slider triangles but they seemed small…I know the can’t be large but I wondered how they were going to look on a small screen…I was only looking at the module embedded view maybe the panel view is larger…

Just a couple of random observations that I need to go back and confirm but just throwing it out there…

1 Like

You are right, there is a bug with “invert all elements” that flips the icon state but not the slider rendering. Will fix, thanks! :slight_smile:

Well, the docs are outdated, unfortunately. It does not make sense to spend time writing docs while the feature is in flux.

1 Like

Thanks for the feed back… I wanted to run through it in a logical way before I i suggested anything might be off…I’m glad you could decipher my ramble :grin:

1 Like

I’ve download the latest build and had about 30 minutes of playing with it. So this feedback is more to do with general options for the mask panel, rather than the nitty gritty of masking. (I haven’t even touched raster masks yet).

Love it! As an owner of a 34" ultrawide monitor, the ability to dock the panel to the side of my modules is amazing.
It also makes the module panel much cleaner, reducing the vertical space it takes up and decluttering it in general.
Previously, with a module like Color Balance RGB, a lot of vertical scrolling would be needed when using masks, but now, it’s much neater, like this:

As for the 4 functions you added to show and hide the panel, I would use them all actually.

  • The permanent mask icon in the bottom toolbar is a nice constant feature so you can never really get lost.
  • The band that appears to switch sides is great. Although I will probably mainly have it on the right, there may be times with XPan crops, when I want to switch sides.
  • Double-clicking the header to fold it away is a nice QoL feature
  • Clicking the panel edge to resize is again another nice QoL feature

I noticed when choosing to dock the mask panel to a separate panel, it defaulted to the left side for some reason. Not a big deal, but it was the opposite to what I wanted. But the setting is sticky, so once I moved it my preferred side, it always opened there again.

Maybe an icon to dock the panel in the module from the side panel header would be nice?

But other than that, I’m very happy with these panel features. The only option I probably won’t use is “utility module, left panel”, which will take me back to the dark days of the Mask Manager, but it’s nice to have it as an option.

As for the Options when right-clicking the mask icon, they are all very helpful. I especially love the option to “preview channel under cursor”. This is much more user-friendly than needing a cursor hover + keyboard shortcut each time.

Couple of observations:

  • When using on-canvas tools, the outlines of shapes turn bold and are much easier to see. However, when using the in-panel controls, e.g. to resize/feather the shape, the shape outlines are not bold and therefore faint and hard to see. Maybe the shape outline can be auto-bolded when you click on the shape header?
  • Some of the text for the mask options are not respecting the language chosen in Settings. I have “English (en@Truecase)” as my setting, but most of the text is still all lowercase. I assume you are aware of this

I’m very impressed by how far this has progressed in such a short space of time. I feel like I’ve only scratched the surface, but I can already tell that the overall concept and usability is excellent.

2 Likes

Thanks for your kind words :slight_smile:

Yeah, good point, “next to where your processing modules are” (be that either left or right) should be the default.

Currently it is selected when you select the shape from the panel, but yes, simulating hover would make sense. I would say that whenever you are hovering an element on the panel, that element should be highlighted on canvas if it has a canvas presence.

All text must be lowercase by default. en@Truecase (which I didn’t know about, by the way) must be a “translation” of the UI strings.

1 Like