How to mask that sky in Darktable

@kuro68k is asking about masking in Art - How can I mask the sky in this photo?

I tried this in DT but not very successfully. Does anyone know how to do it?

It would be very nice if DT could combine masks with parametric elements. I know a mask can use more than one parameter e.g. hue and brightness, but even so it is not always possible or easy to get the mask you need.

What if there was a “mask combiner module”. This would take as input two or more raster masks already present at the relevant point in the pipe. The user would choose which raster masks. The output of the module would be a new raster mask combining all the inputs by some algo e.g. average, power norm, subtract etc.

If the usual set ops were provided e.g. union, intersect, minus then I think such a module (or a few instances of it with different ops) would be very powerful.

Anyone up for a POC?!

1 Like

I use a parametric and drawn mask all the time. Is this what you’re asking for? There is a button for it on the mask bar.

The manual shows how to do most of this.

https://docs.darktable.org/usermanual/4.6/en/module-reference/utility-modules/darkroom/mask-manager/

I’m not very skillful in masking, so I got this:

PXL_20241229_083121489.NIGHT.RAW-02.ORIGINAL.dng.xmp (8.7 KB)

1 Like

This is an example of a very difficult sky to select because it has a non-uniform color with the cool coloured sky but the warm tones near the horizon so selecting based on color would not work unless you just wanted the bluish sky selected.

Tried drawn:

If you need to remove the pole from the mask you can add another shape for it, and set this shape in substract mode in the mask manager:

Thanks for having a go @gigaturbo . This mask could be ok, depending on what you wanted to do with this image. However it includes part of the post, which could be a problem, and on the far left it’s not too tidy with the edge of the building.

@paperdigits , yes I’m aware of this of course, and para+drawn is my usual go-to. Part of the purpose of my post was to increase my and others’ skill with masking. You are an experienced DT user so if you can make a mask for this sky please let us know how.

@g-man , the mask manager only supports drawn masks, not parametric ones, so is of limited value. I suspect hardly anyone uses it based on it rarely featuring in Pixls. The UI is horrible IMHO.

@tankist02 , thanks for having a go. As @Terry says, it’s hard to get the more orangey bit in the mask.

A mask-combiner module could deal with this sky like this…

First I used a para+drawn mask using Hue to capture most of the sky -

Then a second para+drawn to capture the more orangey part. This used Hue and “g” (grey).

Combining these together might be enough depending on what you want from the image.

I tried to get a better capture of the top left area using Hue and g again, though it’s a bit sparse.

Had another go at the top left using low chromaticity, Cz, this captures the sky better but includes the post.

I have limited time so haven’t tried some of the other mask params like contrast and feathering.

I’d have thought combining 1,2 and 3 into a new raster mask would be fine.

PXL_20241229_083121489.NIGHT.RAW-02.ORIGINAL.dng.xmp (65.7 KB)

I admit that I very rarely use it, and I find the UI a bit confusing. I feel like it’s an example of a powerful feature that I forget how to use and need to relearn it each time I want to use it. (When I say “relearn”, it’s not a big job, but I need to remember how all the different modes interact and how groups work.)

Although Darktable has very powerful masking features, it can still be hard to draw accurate masks in certain scenarios, like this image shows. Maybe your suggestions would help, I don’t know. I actually try to avoid this kind of large-area local masking with hard edges as much as possible because I feel it can quickly start to look unrealistic. I prefer to make subtle global changes to tone, saturation and hue with parametric masking.

On other sites, I often see people reluctant to use Darktable because its masking features are behind AI offerings. But other than some very specific use cases, I always wonder why people need to mask so much anyway. Other than subtle changes, a good image should stand on its own well enough.

3 Likes

In my rambling comments to @kuro68k on his art post about this image I basically did what you did above ie step one and two and in ART you can do both together…step 1 I did a parametric mask and step 2 I added a color similarity for the other region and tweaked them until they blended together…I assigned the same tool to each and would just then use the same settings in each for a common effect…I did abandon it due to the noise and artifacts on the pole and line I felt that in the end a global or maybe a gradient sort of treatment would be a better way to go that trying for a total sky isolation…

I did a half-ass job on drawing the masks, but is this what you are going for?

I originally posted this in the RT thread.

@gigaturbo has a cleaner mask. He uses different parameters, but you can mix 'n match to your hearts desire.

3 Likes