Discussion:
[Darktable-users] Shadows/highlights
KOVÁCS István
10 years ago
Permalink
Dear All,

I've been struggling with darktable's shadows/highlights module. It
seems to do really weird things. The examples shown below are
exagerrations to show the effects more clearly.
The manual says:

shadows: This slider controls the effect on shadows; positive values
will lighten up shadows while negative values will darken them.

radius: This slider controls the radius of the involved blurring filter.
So, it seems the image is blurred as part of the processing; I'd
assume that it is the blurred image that is then examined to determine
if a part of the image is dark, midtone or a highlight area, and
adjusted accordingly.

compress: This slider controls how strong the effect extends to
midtones; high values reduce the effect to the extreme shadows and
highlights; low values cause strong adjustments also to midtones.
So, set to 100% would only affect pure black/pure white (everything
else is considered 'midtones' and not affected); 0 would affect all
tones (anything darker than some mid-point would be considered dark,
anything above it a highlight); 50 means a sizeable chunk of midtones
are left alone.

This seems straight-forward enough. Unfortunately, I sometimes see
behaviour opposite to the things described above.

Here's an underexposed image of my son, with 'original' selected in
the history stack (no base curve, sharpening or any other processing):
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-56chChV/0/O/00-base.jpg

Here it is with with an exposure correction of 1.5EV applied to it:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-PLR8gMd/0/O/01-exposure.jpg

And here it is with Shadows/highlights at default settings:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-CpM2Qjd/0/O/02-sh_defaults.jpg

Let's leave highlights alone, I only want to lift the shadows around
his eyes. -> highlights = 0
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-MxLRB8c/0/O/03-sh_shadows_only.jpg

Let's set radius to 40, that will make the effect stronger on the eyes.
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-638S6BB/0/O/04-eye_closeup_radius40.jpg

Now his eyes appear brighter, but I'd like to lift the shadows under
the eyes. I'll try to reduce compression, so the not-so-dark parts are
also affected. Let's say compression = 20%
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-MTZ7RR7/0/O/05-eye_closeup_radius40_compress20.jpg

Some parts actually got darker than without shadows/highlights! Here's
the same crop with S/H turned off:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-Qgn2vJc/0/O/06-eye_closeup_without_sh.jpg

Now let's set shadows to 100. This makes the eyes ridiculous, but
shows even more that some shadows are darkened:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-xFp9pDm/0/O/07-eye_closeup_radius40_compress20_shadows100.jpg

Let's set shadows to -100, which is supposed to darken them. Some of
them are darkened, but some are lifted up:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-Nm3bJHh/0/O/08-eye_closeup_radius40_compress20_shadows-100.jpg

And here we have 2 S/H modules, both set to 'lighten' blend mode, one
with shadows=50, the other with -100:
Failed to load image: http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-j34DMtb/1/O/09-2_instances_lighten.jpg

The opposite can be done with hightlights as well: sometimes positive
highlight values will darken highlights instead of burning them out.

Is this a bug? A feature? If the latter, can the exact behaviour be documented?

Thanks,
Kofa
Robert William Hutton
10 years ago
Permalink
I do a long description of how the shadhi module works in this video:



Just quickly, the sliders in the shadhi module do one of two things:
some control how a mask is applied to the image to partition it into
three regions: highlights, shadows and midtones. This mask is softened
on the edges by either a gaussian or bilateral filter, of which you can
control the blur radius to make the transition between the region you're
affecting and the region you're leaving alone either sharper or softer.

The other sliders then control what is done to the shadows or highlights
regions, leaving the midtones alone.

Given that you're trying to do a specific adjustment to the shadows
under the eyes, it seems to me that you might be better served by making
a more targeted adjustment, for example by using the exposure module
along with either a drawn or parametric mask to simulate dodge/burn.

Regards,

Rob
...
Robert William Hutton
10 years ago
Permalink
Oh and just quickly, I'd suggest that the shadows under the eyes are
really midtones as far as the shadhi module is concerned, which is why
you're having such a hard time with it.

-R
...
KOVÁCS István
10 years ago
Permalink
Robert,

Thanks for the advice. I've viewed the mountains tutorial again (your
videos are really helpful, so I watch them as soon as they become
available), but that does not appear to explain why:
- a positive shadow correction *darkens* and
- a negative shadow correction *brightens*
some parts of an image.
The example for darkening with shadows > 0 is:
http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-MTZ7RR7/0/O/05-eye_closeup_radius40_compress20.jpg
http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-Qgn2vJc/0/O/06-eye_closeup_without_sh.jpg

In Gimp, using the colour picker with a 'sample average' of 10 at
coordinates [680;545] (corner of the eye) I get (R, G, B) pixels =
(134, 94, 80) for the '06-...without_sh' image and (129, 90, 76) for
the 05 (sh enabled) image.

For lightening with shadows < 0 is:
http://photos.kovacs-telekes.org/Other/Darktable-issues/Shadowshighlights20140105/i-Nm3bJHh/0/O/08-eye_closeup_radius40_compress20_shadows-100.jpg
Again, in Gimp, you can compare the brightness of the blemish
(birthmark) above the eye between 05 (sh disabled) and 08 (sh enabled
with shadow = -100). Reading identical positions with averaged
sampling, I get (197, 161, 145) on 08 and (183, 146, 131) on 05. (The
measurement is not as straight-forward in this case, as I had to
manually align 05 and 08, as DT crashed during the process and I
failed to position the preview window at the exact same pixels).

This may be a side-effect of the halos or I don't know what, but it
sure is rather disturbing to see that shadow recovery (which is what I
mostly use the module for) darkens some parts of the image.

Thanks,
Kofa
...
Continue reading on narkive: