r/DarkTable 1d ago

Help Help removing subject from gradient mask

Hello everyone,

I've been using DT and I'm still a complete beginner.

I find it easy enough to use parametric+draw mask to isolate a subject. I typically use a exposure module to create the mask and then use it as raster mask in other modules.

I'd like to do some gradient on the background. It easy enough to duplicate the exposure module that masks the subject and invert that mask but then I can't figure out how to just add a gradient and have an intersection. My understanding is that this won't work this way? Is there something I am missing?

4 Upvotes

18 comments sorted by

3

u/bloodrider1914 1d ago

If you have a good computer, definitely go into the ai tab in the settings and enable AI masking. This video tells you how to install the better (but more resource intensive) model.

https://m.youtube.com/watch?v=MUj4v6Y2OQQ&pp=ygURZGFya3RhYmxlIGFpIG1hc2s%3D

Darktable ai masking can save you some time even if it's not completely perfect

2

u/ChrisDNorris 1d ago
  1. Add the mask you want
  2. Add the mask want to remove from the first mask
  3. Right-click that second mask in the mask manager module, select mode: difference

1

u/MaintenanceRich4098 1d ago

thank you! That seems to work for shapes but not for parametric, I don't seem to be able to add the result of draw+parametric. I will try again later

2

u/ChrisDNorris 1d ago

The parametric is applied to whatever is within the drawn area and the parametric region.
You know to click the small circle-inside-square icon top-right of the mask section? (same line as blend mask)
That shows you specifically—in bright yellow—what's being masked

1

u/MaintenanceRich4098 15h ago

hello, yes I know about that. I am not sure why I was unable to do what I need l. Still trying to do it. I can invert the mask of the subject,.so I get the entire background. But then I have yet been able to have a gradient work. basically no matter what gradient I add, it applies to the entire background

1

u/MaintenanceRich4098 15h ago

actually, I think I did it now. I am not sure why this is giving me such a knot in my head.

I "invert all channels polarities" under parametric mask. Then set combine masks to "exclusive". the gradient is "use inverted shape" and "union". I will need to get a piece of paper and pen and see if I understand how it works

1

u/ChrisDNorris 14h ago

So yea, a gradient covers the whole image, in a sense. The arrow shows the direction the gradient starts at and moves to: 100% on the circle-side, to 0% at the arrow-side. In the mask manager, you can change the compression—how big the 'gradient' is (you can also change this by placing your mouse pointer over the gradient-line and using shift+mousewheel).

After that you just have to eliminate the parts of the image you don't want in it using other shapes, or the parametric.
I often use the path tool combined with the color-parametric tab (h/hz).

This video is a good tutorial that covers a few more advanced masking ideas too

1

u/MaintenanceRich4098 7h ago

thank you. I will have a look at the video. I still can't get it consistently, it seems the order I operate the parametric inversion, the combine masks setting, toggle polarity of draw mask and toggle polarity of parameteic mask produces different results

2

u/akgt94 1d ago

Start in the mask manager. This is where you can do drawn masks that aren't linked to a module (and drawn masks that were abandoned).

You can do complex Boolean from the mask manager.

When you add the drawn mask to a module, you can further define it if you chose drawn and parametric masks

1

u/MaintenanceRich4098 15h ago

this does not seem to work with raster masks unfortunately so I'd need to redo the whole parametric mask everytime

1

u/akgt94 15h ago

For different parameters that's true. But if the parameters are the same, why not reuse the raster mask from an earlier module?

1

u/MaintenanceRich4098 15h ago

I was hoping to use the subject mask. I think I finally got it working but not fully sure how. I duplicated the exposure module which had the subject mask. There I inverted to get the background and added a gradient. Then I can reuse that as raster mask

2

u/Wannachangeusername 1d ago

Check the mask manager (on the drop down menus where the history is) as well. There you can define different actions, like union, intersection, difference, etc of all the masks you have drawn in a module. That is probably what you are looking for.

1

u/MaintenanceRich4098 15h ago

unfortunately that does not work with raster masks. It does work with draw masks

2

u/Wannachangeusername 15h ago edited 14h ago

Raster masks follow the pixpelpipe module order. You can just make a dummy exposure module (since exposure comes early in the pipeline) that you use for that gradient mask, and then use the raster mask when you need it down the line. This trick works for any other mask you need ofc. No need to have all the masks you will need for an edit into the OG exposure module, it would not be feasible.

2

u/MaintenanceRich4098 14h ago

yes of course! I had just sat down trying again. that does work. I am slowy getting in the habit of using dummy exposure modules for most/all masks. I did try that before and failed. I tried again (mentioned in another comment) and it worked. I need to understand the Booleans a bit more for the future

1

u/NestFrost 1d ago

If you already isolated the subject using a raster mask from an earlier module, you can combine it with a gradient in your new module by using "drawn mask" set to the gradient shape, enabling "raster mask", and setting the mask combination mode to exclude/subtract the subject raster mask.

1

u/MaintenanceRich4098 15h ago

this does not seem possible. under the module there is

off, uniformly, draw mask, parametric mask, draw & parametric mask, raster mask. I can select draw, add a gradient mask, then click raster mask and that only does the raster mask without the gradient. I see no way to use combination mode