Why does increasing the exposure of this image in Darktable seem to invert the background?

Hello Team!

I asked this question on Stack Exchange, but I suspect I’d get more informed answers here.

If you prefer a visual demo I’ve recorded a screencast of the problem here.

I have a test image that I made so I could see how various modules in Darktable effected the histogram:

I import this image in darkable and switch on shadows and highlights, this gives me a result like the below:

enter image description here

(not much has changed, but the bottom stripes are slightly darker)

If I then increase the exposure, everything works as I would expect (as in, the image gets lighter), until I move over about +1EV, which is when the background of the image starts to darken. By +2EV, the image looks like this:

enter image description here

If I switch off the shadows and highlights module - the image returns to what I would expect.

My question is:

  • Why does increasing the exposure of this image make it darker?

…and I wouldn’t mind some context around

  • Is it possible to switch on ‘shadows and highlights’ in a neutal state so that it doesn’t change the image? (like when switching on crop or exposure)
  • Is there a repository anywhere of more professionally generated ‘see what the histogram looks like’ images?

Edit - I upgraded to 3.0.2 this morning and tested again - same result.

I think you answered the question yourself: enabling the highlight and shadow module applies some transformations on the picture that, when pushed in extreme condition, render the background as black.
I tried with your image and if you switch the highlight and shadows module to use a bilateral filter, it behaves as you expect.
I don’t know the exact maths behind that module, but the color space it works on and the fact that at high exposure, your white area becomes clipped, is probably triggering some weird extremes.

Highlights and Shadow works in LAB, which means you can’t push it too far.

Thank you - that’s what I get as well - this starts to look like a bug right?

As paperdigits mentionned, this module works in the LAB color space. That color space works well for some operations, but not everything, and it has some limitations.
That’s why many darktable developers are switching the pipeline to the more generic RGB colors space.
The shadows and highlight module is known to create halos. But this is not an implementation bug. It’s an algorithm bug, in the maths that defines the module behavior. Nothing that a developer can correct. They have to switch to another algorithm.
That’s why the Tone Equializer module should be used for those cases.
To find which are the preferred Darktable 3.0 modules, read the good article by Aurelien Pierre PIXLS.US - Darktable 3:RGB or Lab? Which Modules? Help!