New film-like tone mapping curves - tests/feedback needed

Did you happen to turn on hue matching in curves or tone mapping? That causes the artifacts on the Christmas lights. I never use it because it is too risky for me.

image


Shadow clipping on

image

No, I didnā€™t.
I think it was caused by two tone mapping layers, the later with screen mode. When I turn this one off, the artifacts disappear.

Thanks anyway!

I have just introduced yet another version of tone mapping operator, but this time with the goal of greatly simplifying the workflow.

After having spent several weeks on the subject, I have come up with a relatively simple solution that seems to give good results even in cases with very high dynamic ranges.

The new tool is composed of two parts:

  • a dynamic range compression step based on a logarithmic curve,
    with separately adjustable strengths for shadows and highlights
  • a S-shaped contrast curve with adjustable slope and
    shoulder shape

The old tool with the various tone-mapping curves is still available, and is now called ā€œTone mapping oldā€.

Here is an example, to give you an idea of what can be obtained (the diagonal line splits the previous/after versions):

Pre-compiled PhotoFlow binaries should become available in a little whileā€¦

Iā€™d really love to have your feedback!

2 Likes

The new TM module and its defaults arenā€™t bad. One thing I have noticed is that the processing starts when I start moving the slider. It would be great if it started after I settled on the adjustment. Didnā€™t notice this issue before in the other modules.

PS Noticed that you have added Jzazbz into the soup. Do you have any plans for it?

PPS Example OFF / ON (default). Not bad.

Thanks for the good work!

I did a quick edit with it and got these two strange things:
1 - The curve bended;
2 - Lots of artifacts appeared

I think these only appeared after some back and forth attempts

Follow dng and pfi (licensed under CC BY-NC-SA 4.0)
IMG_4989.DNG (17.8 MB)

IMG_4989-new.pfi (23.5 KB)

It is the same kink problem from filmic+log, which is usually in the toe but could be in the linear section too when parameters are pushed to the extreme.

There are also points when areas in the preview turn black with artifacts at the edges. Sometimes they go away after processing; other times they stay.

Maybe, but I often used linear+log - including for this image - and never got that.

I am just better at testing things, bringing PF to its knees! :slight_smile: Actually, maybe @chroma_ghost is because PF crashes like no tomorrow for him.

1 Like

@afre @gadolf I am trying to fix/mitigate the ā€œkink problemā€ right now. The main reason for it is that currently the higher the slope, the wider is the toe (the red part of the curve). To the point where it goes beyond the linear rangeā€¦

1 Like

Please, take your time.
I like the ā€œoldā€ linear+log module, so Iā€™ll keep using it with my real edits.
I donā€™t have much trouble with all its parameters. (Not saying that I understand what they mean, but I tweak them in an intuitive way, and it works for me)

1 Like

Is that always related with large values of the slope parameter?

I think so. I actually donā€™t use PFā€™s tms often enough to know for sure. I mostly use them to see what is possible and then let that inform the rest of my post-processing workflow.

Here is a preview of the next feature that I am introducing in the tone mapping module: local contrast.

The shoulder in the tone mapping curve can nicely recover highlight details, but micro-contrast gets flattened on the way. The local contrast adjustment allows to re-introduce some of the flattened textures. If pushed too far, it can generate the classic ā€œfake HDR lookā€, but used with a grain of salt it can really give some extra pop that remains natural-looking.

This is the initial image:

Tone mapping, flattens the textures in the highlights:

Local contrast pushed to the maximum, too muchā€¦:

A reasonably good compromise:

What do you think?

3 Likes

Great!
At least from this image, it seems that the maximum local contrast completely recovers details lost by other processing, so Iā€™d say that it should be set at 100% always (youā€™re not adding more local contrast, youā€™re just recovering it as it was originally)
On the other side, maybe I donā€™t want to always compress the dynamic range to 100%, so isnā€™t it better to separate local contrast from the compression amount applied?
Not sure if I made myself clear enoughā€¦

I am still uncomfortable with your tm (old and new) slider labels. In particular, amount doesnā€™t mean anything in particular. If you are calling it local contrast here, it should probably be called that in your app. detail may also be an apt name. I say this half-jokingly but you could even call some of the sliders by the colours of the curve.

Personally I find that a bit of local contrast loss in the compressed highlights is not bad, and looks quite natural insteadā€¦ so I prefer to leave the amount adjustable.
If the curve is straight (no compression or contrast increase at all) the amount slider has no effect, because one is effectively removing and re-introducing local contrast to the same image.

I am open to suggestions! In the amount case the slider is supposed to be inserted in a ā€œlocal contrastā€ frame where there will be also two sliders for the radius and threshold of the guided blur filterā€¦

Hereā€™s one more test.
This time, Iā€™m comparing a small region of an image where I know thereā€™s a thick layer of dust on the wall. The dust is seen as brownish splotches.
The comparison is between Darktableā€™s filmic and linear+log tm (I tested with all other tone mapping curves and the result is the same - regarding the dust layer), and Photoflow seems to desaturate it more than Darktable, specially on the region marked by the green circle.
Darktable:

PhotoFlow:

I exagerated saturation to make the difference more visible.
Follow respective sidecar files:
IMG_5427_alt.pfi (27.8 KB)
IMG_5427.DNG.xmp (4.2 KB)
IMG_5427.DNG (17.8 MB)

When zooming out both programs, the overall difference between both seems to be a little less vibrancy in PhotoFlow.

I know itā€™s hard to compare different algorithms from different programs. Because of that, I tried tweaking PFā€™s tone mapping settings to recover that brownish blotch, but all i got was a dark one. Somehow the color seems to be missing.

@gadolf As far as I can see, the increased saturation in DT comes from the ā€œpreserve chrominanceā€ setting, which generates an image that is over-saturated compared with a similar region of the original image that is simply brightened with an exposure compensation.

Remember: exposure compensation, if applied correctly, preserves both the hue and the saturation of the original colors. It is equivalent to an in-camera adjustment of the shutter speedā€¦

I wonder if this is closer to what you were looking for:

I have reduced the contrast and the knee strength of the tone mapping curve a bit, to avoid darkening the shadows too much, and I have used the ā€œcolor correctionā€ module for saturation boost. This uses the saturation adjustment algorithm recommended for ASC-CDL, while the ā€œbasic adjustmentsā€ tool is still based on a legacy HSV colorspaceā€¦

Getting rid of this bit of mess is part of the work I have ahead of me!

I have yet another update of the filmic curves, with further improvements.

There is now a first section with two sliders that allow to control the global dynamic range compression, for shadows and highlights separately.

The second section has sliders to control the shape of the tone-mapping curve, as before.

The last section groups the sliders for the adjustment of the local contrast.

This is how it looks like:

@gadolf @afre since you played quite a bit with the old tone mapping curves, I would be really interested to know if you can easily obtain similar results with the new interfaceā€¦

@Carmelo_DrRaw As soon I have a spare time Iā€™ll check that.

Meanwhile, I noticed that the OCIO filmic still shows those squares if I donā€™t set LC_NUMERIC manually.
Another thing that I noticed just now (by looking at your last screenshot, is that the popped out tools donā€™t show the close, minimize, maximize buttons. Maybe some Ubuntu/Gnome stuff interfering hereā€¦ itā€™s kind of weird when I want to get back to the main window, I have to drag the tool out of sight so that I can see the main window

image