PhotoFlow - new dynamic range compressor tool (experimental)

I have added separate adjustments for shadows and highlights to the dynamic range compression tool.

At this point, this new tool is a valid replacement of the existing shadows/highlights tool, which I will then remove from the UI (but will still remain in the code, and be available when opening old PFI files that made use of it).

Here is a brief explanation of the filter parameters:

  • shadows/highlights strength: how much compression to introduce (0 gives the input image)
    the filter preserves mid-gray, so whatever the value of the S/H strengths, a 50% gray patch will not be modified
  • local contrast: amount of local contrast that is re-introduced in the image.
    The local contrast is computed as log(L) - blurred(log(L))
    A value of 0 means “all local contrast is added back”,
    -1 means “no local contrast” - equivalent to the filter applied directly to log(L),
    +1 means “local contrast is added back twice”
  • coarseness: radius of the underlying bilateral blur, expressed as a fraction of the image dimensions. Too small values can introduce visible halos.
  • edge threshold: value variance of the bilateral filter. For higher values the filter will be less effective on textures (i.e. textures are preserved and not compressed)
2 Likes

@Carmelo_DrRaw no problem, and great result!
How about this one?
http://rawtherapee.com/shared/test_images/soderasen_1.hdr.dng

@Morgan_Hardwood

here is what I could achieve with a quick edit (dynamic compression + film-like tone mapping curve):

28

hdr-phf

I also did a quick test with the tractor image (dynamic compression only):

31

tracteur-phf

The main limitation for the moment is speed at large coarseness values, but I have some ideas how to improve this…

What do you think?

Looks very good!

@Carmelo_DrRaw, perhaps you could try this pic of a samba band (well half, the other half are rather hidden). I had to use a fairly extreme curve to get it passable, and it shows! The raw is here -
https://filebin.net/slfh18kcx8nhgc9j


00518-Sambistas-crowd.jpg.out.pp3 (10.7 KB)
Keep up the great work!

Default settings using the current version of PhotoFlow.

image

Here is what I get with my usual combination of dynamic compression and film-like curve:

I had to work on a scaled-down TIFF file, because the current code is still too slow to process such big images. Anyhow, here is the corresponding PFI file: 00518.pfi (10.5 KB)
If you want to use it, you first need to process and export your RAW image into a 32f TIFF file in linear REC.2020 colorspace; I have used the 4k preset for the TIFF size.

I think that the shadows recovery looks quite natural… what do you think?

Here is a screenshot of the settings I have used:

56

1 Like

Indeed, the default settings are rather aggressive, especially on images like this one that do not need very strong adjustments:

Lowering the shadows/highlights strength gives some more natural result:

The weird dots only happen at the fit zoom level. And yes, the defaults are too much. Perhaps set them to a lower amount like 10s.

I think it’s good, it looks pretty natural to me (maybe a bit more saturated than I would do), and it captures the bright feel of the event well. Thanks.

1 Like

Great tool!

Before applying a curve, there were some black spots (out of gamut pixels?):

source:

1 Like

@Carmelo_DrRaw while uploading the source file my computer froze. Before rebooting, I noticed that memory consumption was on top (see the green indicator at top). PF was opened at that moment.
Any possibility of a memory leak or something?
I’m on Ubuntu 18.04

Yes, I cannot exclude this. The tool is very new and still under heavy development… I will check the memory usage.

Thanks!

1 Like

I am really proud to announce that over last weekend I have managed to achieve a HUUUUGE speed-up of the new dynamic range compression tool, such that it is now possible to get a real-time preview even in the case of a 50Mpx image.

On my laptop, exporting a 50Mpx TIFF processed with coarseness=2 (which means a blur radius equal to 2% of the smallest image dimension) takes about 9s, which I consider quite reasonable given that the code has no SSE optimizations - at least not for the moment.

The tool is still very experimental, which means for example that the range and sensitivity of the sliders might still change in the near future, nevertheless it would be nice of people could challenge it on difficult images to see if they like the result.

Thanks for checking!

2 Likes

Issues
1. Something wrong with the top and right edges, esp. when shadows, local contrast and/or edge threshold are turned up.

2. Coarseness crashes when set to 0.

3. Edge threshold doesn’t crash at 0 but looks the same as 100.

Yes, it is very fast now! Thanks. However, the icons for minimizing/full screen the window seems to be broken. See top right corner of

EDIT: I am on Win 10.

The gtk2 version doesn’t have this problem.

Could you please check if this is fixed in the latest version?

This should also be fixed in the latest version.

as mr @afre licious ( :male_detective: ) mentions there’s some rust in the sliders… also ( last properly working itiretaion was 7_jun if not mistaken) masks layers and clone layers are not working as expected, at least in the dynamic range tool. At first, didn’t take much to crash PhF… then, on a second go and leaving the beforementioned bad-behaving-child-eater-slider managed to edit for 18 minutes before crashing. Andreas you’re a bad-ass penguin punisher, other than instructions to devour my soul, your baby is flying high (for the 1eye larvas that means it’s waaay faster). Need to eat now, cheers :beers:

 
PS
@shreedhar that physalis enterprise looks just lovely =)

I can confirm that coarseness has issues. I cannot reproduce it every time but:

1. Sometimes it takes a long time to process.
2. Other times it just crashes.

Also, a pattern is visible when in fit zoom, which appears to increase with higher edge thresholds. (PS It could be a limitation of this technique. I don’t know.)

(It seems that fit zoom often has artifacts like weird splotches and noise squares. Maybe it has to do bad or non-values or how the preview is generated.)

1 Like