Development Idea: Sky and Foreground Masking

Hi there, I would like to share a development / improvement idea based on my workflow for editing sky and foreground.

When editing landscape images woth complex horizons (e.g. mountains), I would usually select the sky with AI masking (Many thanks for this new feature!). Then I would shrink mask slightly to have some space at the horizon (Many thanks for this new behavoir as well!), move upper / side mask outline back to the image border and add a slight feather. I would repeat this for the foreground by selcting the sky again, but now grow the mask slightly and invert it (+feathering).
Based on these two masks I would edit sky and foreground seperately by using two instances of color balance rgb.

Now, while the workflow is good, I think this could be partially “automated” by selecting the sky once and doing the masking steps described above automatically (shrink for sky (+move upper and side mask border to image border), grow for foreground, feather). The results could be a sky mask and a foregound mask ready to be used in the modules.

Is this something which is already in the development pipeline?
Do you follow other more straight forward workflows? Let me know!

Many thanks!

It is good to hear your suggestion and allow the developers to consider this. For me I don’t find a need to shrink the sky as feathering usually does the trick for me. I also only work with one mask for the sky normally. I might optimize the foreground and then used a masked sky to tweak the sky. I don’t consider a separate mask for the foreground. Just my workflow.

2 Likes

This seems a specific instance of a more generic request for some kind of automation, i.e., macros.

Currently you can assign a shortcut to an action, but you cannot assign it to a sequence of actions, which is the missing bit. Also, note that actions may have a direction (effect), but they do not encode a numeric value unless they are hardcoded with that specific value (e.g., increase exposure by 1 EV).

For the specific usecase, maybe you can achieve the desired result with a lua script. I am not sure if the api covers all the actions that you need. Maybe @wpferguson can clarify that?

2 Likes

Thanks for your input!
LUA is a great idea. However, it looks like most of the steps are not supported by the LUA API.

I rarely try the sky with a drawn mask. I will get the best parametric mask using an early exposure module. You can even optimize contrast there by changing the exposure to make the mask and then restore it after using another instance…then you can use that as a raster mask and the inverse for the foreground… Or sometimes the blue channel and jz are a good combo and then you just loop a drawn mask around to protect some areas outside the sky that might get picked up … touched up with mask contrast and feathering that can work too…

3 Likes

Lua can control the darktable UI using darktable.gui.action() calls to shortcuts to modules and module controls. You might have to select the mask, but you should be able to script a set of actions to apply to the mask.

Many thanks! Will give it a try.

FYI: I ended up using LUA for instantiation and setup of processing modules and kept the mask creation and manupulation manual as it is barely possible to automate things here,

1 Like