Local Lab build

I did a review of “Guide filter radius”…
It’s a complex thing, because in one case, it uses “Log” values, and in other “normal” values with two different goals !

I hope it’s solved :slight_smile:


Thanks Jacques, now it works. By the way, Ithink it should “guided filter”, not “guide filter”.

Now, I see that the Chroma slider has also a problem with range: most of the effect occurs between 0 and 1, and only small changes are seen from 1 to 100.

A majority of bugs have been solved.

In addition I modified the parameters that take into account the size of the preview to make less sensitive the differences between preview and TIFF/JPG

I added a function that I think is useful - I included it in the “Soft Light” module to not add a module, but I could have put it somewhere else

This function is named “Original retinex” or in internal “Retinex_pde”
It aims to reduce the differences between shadows and lights -following the Retinex principle developed in the 1970s 1980 - for example in a portrait and avoid many individual retouching with brush (that is not in RT) or with a RT-spot

Summarily it uses a Laplacian “adjustable” with 2 sliders, then a Fourier transform, then the resolution of the Poisson equation (PDE), then a balancing of the luminances


I just made two improvements

  1. for Retinex_pde, by introducing 1 more slider, which takes into account the deltaE in the use of Laplacian…this allows to better differentiate the foreground and the background

  2. for Retinex (MSR multiscale retinex) and Tone mapping, I add a function - of course you can disabled - “nomalize luminance”, useful in this 2 cases where luminance and contrast are very strongly changed. The algorithm takes into account the luminance and variance of each image (before and after TM or Retinex) and “equalizes” them.



I added to “Local Contrast” as well as to “Retinex” the possibility to use FFTW (Fast Fourier Transform) to generate the blur instead of the function “GaussianBlur” present in Rawtherapee.

This function presents 2 optimizations:

  1. multithread with OpenMp
  2. adapted “generaly” the size of the Rt-spot, in such a way that each of the dimensions is compatible with the prime factor decomposition below (this optimization il also in Retinex_pde)
    2^n * 3^p * 5^q * 7^r * 11^y * 13^z with y+z = 0 or 1

With this optimizations the treatment time is rarely inferior to the traditional method, sometimes higher, but acceptable!.

But, there are several advantages:

  • it is possible to increase the size of the radius (sigma), without affecting memory and processing times.
  • the results seem to me better quality because we strictly apply the Gauss formula :
    G(x,y) = (1/2 * PI * sigma) * exp(-(x^2 + y^2) / 2* sigma^2)


Two complements to my text above

  1. the adaptation of RT-spot is about some pixels and should have very little impact
    For example if user select a spot with H=2020 W=1349, system will calculated new dimensions Hr=2016 Wr=1344
    Other example H=1200 W=944, new dimensions H=1200 W=936.
    This reduction can reduce treatment time up to 4 or more times.

In the case of Retinex (due to code complexity), this optimization does not work if the 2 delimiters (separatly for horizontal and vertical) are outside the all image.

  1. in fact, the formula used to “blur” is a transformation of G(x,y) adapted to FFT
    G(x,y) = exp((-sigma)*(PI * x^2 + PI * y^2))


1 Like

Trying to do some local adjustment with RAW file from this thread . Using the Elipse and all I did , was using the “Exposure”

I’m not happy with the result , or maybe I’m doing something wrong ?
Exposure in Global adjustment is working just fine. Nothing to complain about it.

playraw.RT4.jpg.out.pp3 (18.5 KB)

The last picture is Lightroom and radial filter (the same as the Elipse )

RT 5.6.947 and Windows 10

Try raising the “scope value” and/or increasing the spot size. In your test the small spot in the dark part of the truck cabin, and small scope value, mean that the tool is going to try increasing the exposure only of similarly dark tones.
Or maybe try the local shadows/highlights tool instead, if what you want is to raise the shadows inside the cabin.
What were you trying to achieve?

1 Like

Tried to raise the scope , helped just a little. Highlight compression helped - but prevented lifting of the shadows.

Using the Shadows/Highlights did give a much better result as shown below

(18.5 KB)

Using the Exposure in local adjustment is giving me strange result with many pictures. Can’t figure out , how to use it. It’s just confusing me.

@Dxouser For some reason, I found placing the spot on the wall behind, then raising exposure by 2 stops and drawing S shaped curve seemed to work. Also made rectangular shape over cab and raised exposure by 1.7 stops.

Here is the pp3
Playraw_spidermonkey.NEF.pp3 (24.2 KB)

Looks OK to me, but not as good as some other people’s

Since one mounth I introduced several improvments

  • Original retinex with “Laplace transformed - Fourier transformed - Poisson PDE” which in some cases can replace “Dodge and burn”

  • Similar function as above, add to “Exposure”, which improves the results in difficult cases (pronounced shadows …)

  • Normalize luminance for Retinex and Tone-mapping. if checked “Luminance” result as the same “mean” and same “standard deviation” as original

  • Add a method to “Local contrast” with “Simple Wavelet” (same algo as in Wavelet “Final touchup - final local contrast”

  • Add 2 methods in “Blur and noise” : median (same are used in Denoise), and Guided filter

  • Add mask to “Tone mapping”, and “Blur and noise”

  • add mask in inverse mode for “Color and Light”, “Exposure”, “Shadows Highlight”, “Blur and Noise” with certain limitations (do not show modifications)



The version newlocallab 5.6-1144-gd39eded26 crashes, when you want to paste or save a partial pp3. This does not happen with version dev 5.6-219-g972d6907d.

Concerning the GUI: Can the spot management be implemented with inline editing/buttons in the table? Replace the big “status” column with a slim one containing just an Icon, e.g. an eye or glasses, that can be pushed to toggle visibility.
Double click on the name field opens a line editor to change the name in-place.
What also would be awesome: allow enabling/disabling a spot. Another small column with an icon for each spot could handle that.

That way we can get rid of two buttons (Rename and Show/Hide) and get a full line space saved and gain space for the “Name” column. And Showing/Hiding/Renaming requires less work, especially when going over several spots.

Just a small mockup:

Regarding the GUI. I would love to be able to select an area with more precision using something like a lasso tool. It is hard to do it with the elipse/rectangle.

Something like this:

This crash has been solved under Github

Hello All,

For your information, I have started a new session of improvements of Locallab GUI.

You can follow what is planned and the progression here:

Thanks for the suggestion: I was also thinking about implementing kinda the same, or maybe adding some right-click menu on spot list, idk… I will see when I will be working on this code part.


1 Like

Thank you

Just to clarify my understanding of the new proposed interface. With the current set up it is possible to select an area with a spot then apply many different adjustments (eg tone curve, local contrast) to it. With the new proposed layout would it be necessary to create a new spot for each adjustment made? Perhaps I have misunderstood it. Thanks.

With the new proposed layout, after creating a new spot, no adjustment will be attached to this new created spot. Thanks to a combobox widget, you will be able to add several different adjustments (from zero to all of them) to the selected spot (or remove them). Of course, if you add all the adjustments to a spot, you will have the current GUI behavior. The idea is to optimize the GUI to only show the adjustments you choose to use on a selected spot (and not having to find the tool in the middle of the 12 others)


1 Like

Ah, thx! That really would make editing easier. As long as I can still temporarily disable a module to see its effect.