How to balance exposure with external raster mask?

A great thank you Todd, actually that works using divide, I misunderstood at first! And I am surprised how well that works, even though I have not been using a tripod, so the background does not align perfectly, the overall light distribution is much better. What I did different is that I had just used the tone curve and pulled up the left hand side and pulled down the right side to invert the background image, as I was not sure about the exact parameters using negadoctor.

For example, this is another shot from the same scene, that I had taken a couple of hours later handheld, so definitely not the same position:

The original image:

And the inverted background image from the initial post blended using divide and increased fulcrum:

That will save me tons of editing time, and I will use this in the future more often! What a great functionality from Darktable, I don’t know if any other Raw editor is capable of doing such things. I have the impression it even removes potential color casts?

2 Likes