How to edit a drawn mask.

I’ve drawn a mask, using the bruh too, over a subject for which I want to change the exposure. My drawing has not been good (shaly hands, usig mouse instead of pen). Yes, using the combination of mask feathering, opacity and contrast I am able to improve the fit of the mask to the subject but tre are areas where I have drawn grossly outside the subject.

My natural reaction was to look for something analogous to being able to paint black or white on the mask in Photoshop. Is there any such equivalent in darktable, which would allow me to add to or trim the mask - aside from the (to me) painful process of editing all those red bezier curves shown within the mask?

2 Likes

One recommendation: if you make such a request, please do so with a concrete example. It will be much easier to find an adequate solution. This will save us a lot of talk in advance.

I take your point, but I do not want to create a situation where I get guidance which is specific to a given image. I want to know the principles - and I think that this is what this forum is for (but not exclusively, of course).

2 Likes

Darktable isn’t photoshop, it doesn’t really use bitmap masks (there is something called a raster mask, but that’s a special case, probably not relevant here). Masks are all stored as shapes, (circle, ellipse, path/curve), not as bitmaps. As such, you can only edit them by editing the control points.

As for your “natural” reaction, I’d say that’s an expectation carried over from photoshop and similar, not an inborn reaction :stuck_out_tongue: (that’s not to say that a mask function like you expect wouldn’t be useful, but it’s not available in dt at the moment).

1 Like

Currently there is no eraser tool for the brush mask. Brush tool is also not really a brush tool but more like a freehand draw tool.

Currently your best bet for that image is either to use path tool for that drawn mask or a combination of path tool drawn and parametric mask.

But to be frank, if you have more than a few images that require that kind of editing your best bet would be to use a software like Lightroom and come back in a few years and evaluate darktable for your kind of work.

Thanks everybody for the explanations and background - that stops me from searching for a function/module hat doesn’t exist. I’ll try to follow, more accurately, the technique described in
https://github.com/darktable-org/darktable/pull/1809

1 Like

Have you read the documentation? darktable 3.4 user manual - drawn masks

What do you find to be missing from the docs?

1 Like

Given the guidance provided by others, in earlier replies to my post, I don’t (at the time of writing) immediately notice anything missing from the docs (which I had read, but which I am quite capable of mis-understanding; hence the question in my post). What I clearly did not read into the documentation is that there is NO facility to use the brush in an ‘erase’ mode, such as exists in the bit-mapped masking of Photoshop. With dt, when using the brush, I can only extend the mask; to decrease the area covered by the mask shape I must edit the nodes which define that shape. In my opinion this is more work - considerably more work - than using an ‘erase’ mode.

I may be completely mistaken in my understanding of the difference between vector and bit-mapped graphics, however I am of the impression that vector based graphics are a way of enabling far more powerful mathematics (using matrix manipulation ?) to be used to determine how the properties of a pixel (in rgb or lab terms) are to be set. That is, at the end of the day, the value of each and every pixel has to be calculated as if bit-mapping were being used. If that is true, I’m not sure why an ‘erase’ option for the brush tool is not supported.

Indeed when I look , at sufficiently high zoom rates, on some of the mask details produced by the brush - i.e the parts of my image which appear in yellow - then it looks like just single, isolated pixels are defined as being included/excluded at the edges of a mask.

But, what do I know? I couldn’t transpose a Hamiltonian if I tried, even given the appropriate surname.

have a look at this combination of 2 brush strokes:
image

you need mask manager to add the second stroke in difference mode

Oh yeah, that’s another solution too. I guess it would be helpful to implement something like shift+click on the brush masking tool to automatically go into difference mode while painting. That way ctrl+shift+click would give you the multiple stroke mode for the “eraser” brush tool

The problem that still remains is that brush is used for layering opacity meaning the more you brush over the same pixels the more opacity your mask has assuming you don’t have the brush opacity at 100%. For the eraser it would be the more you brush the more you take away the opacity.

Without that, the whole brush concept falls apart. And while in theory you could make a few overlapping strokes and change the opacity of each one afterwards, I’ve found that the mask gets the opacity of the stroke with the most opacity meaning that it’s not actually layering opacity. So if 2 strokes cross over, one stroke has opacity of 80% and one has 20%, the crossing part will be of 80% opacity, not 100% as one would expect.

Mask manager also hides most of the settings that you can do using shortcuts like opacity, hardness and size.

I think it could be improved a lot and be made much more usable even without raster brush masking or live rendering. But for now, it’s just not a good experience to implement in ones daily workflow.

It can be done or used, but it can’t be relied upon and ergonomics aren’t good.
And since the OP is asking about using a brush in general, probably meaning he has multiple images and more than a few strokes of brushing to do, I’d advise him to use a different software and check back in a few years.

Hmm, that is quite fascinating: there is no way that I could have thought of doing this; so, many thanks for the concept and the illustration

I need to experiment for myself now to see how I can apply this. My immediate reaction is to wonder how to ensure that the second brush stroke only acts as an eraser to (parts of) the first stroke, without adding its own mask to the image. I’m assuming (until I have tried it) that this is what ‘difference mode’ will do.

Like I said, there is no erase tool and there probably can’t even be one because the stroke is actually a line with a radius and you can’t erase part of that radius etc.

Then again, Lightroom seems to have a vector brush too, but it feels just like a raster and just like what you are asking for so maybe it’s technically possible, idk?

One problem is the live preview of stroking. So you don’t actually see the result until you end the stroke and it gets computed and that won’t be implemented as it would require a great change or a great hack in DT but maybe if we forget that part and focus on the rest, maybe something can be done and improved, idk tbh.

it depends on the order of the strokes in mask manager.
here a 4 lines scenario: stroke 2 (left vertical) & 4 (right vertical) are in difference mode

You can also just delete and add nodes . Picking the right ones will quickly correct things also brush on much less than you thing and then expand with feathering…still not you erase brush but you can get better with them

Yes, sensible advice.