Some news about RawTherapee’s Local Adjustments and recent Rawpedia updates

Hi all
We add (Ingo and me) a new tool to “local adjustements” “denoise”…
It’s name “Non-local means”

Commit “dev” - 6ad419f - 5 February 2021

=======
Local adjustments – Denoise – improvments with Non-local means

What is « Non Local Means » ?

Here Wikipedia definition : Non-local means is an algorithm in image processing for image denoising Unlike “local mean” filters, which take the mean value of a group of pixels surrounding a target pixel to smooth the image, non-local means filtering takes a mean of all pixels in the image, weighted by how similar these pixels are to the target pixel. This results in much greater post-filtering clarity, and less loss of detail in the image compared with local mean algorithms

In french this algorithm is named « Débruitage par morceaux » ou « Débruitage par patch » which seems to me more explicit.

Where it can be found ?

it seems that this alogorithm is used by DxO

The algorithm used here is close to the one implemented by IPOL in 2014

The work of Alberto and Ingo

I had thought of implementing this algorithm, but Alberto @agriggio was faster and made very good improvements with the help of Ingo @heckflosse . Thank you to them for this excellent work

These improvements can be achieved by :

  • used of OMP and SSE
  • used of Tiles
  • used Laplacian and mask to better improve edge detection and thus differentiate the action between solids and textures.
  • limit the use to luminance noise, because indeed the examination of other software shows that chromatic noise is often better processed by other algorithms (Wavelets, GuidedFilter…)

My choices

I made the choice to implement it in « LA », but it is possible to do it for the other denoise modules of Rawtherapee (Noise reduction, Wavelet levels)

What are the differences with the ART version ? For the code itself few deviations.

I used Lab instead of Yuv, because the base data are in L (Lab)…for this I applied a transformation to make Lab “variable”, by default I applied a gamma=3.0 and at the end inverse-gamma=0.3333, but, with the help of Ingo, you can vary the gamma and thus change the distribution of denoise according to solids and textures. . For recall Lab consists of a system with gamma=3.0 and slope=9.03

In «standard and advanced mode » I use “gamma” as above and I enable the 2 hiden variables in ART « max_patch_radius » and « max_search_radius » (advanced) which allows to better adapt the algo to the details of the image, but which resulted in an increase in the processing time for the 2nd.

And of course everything that will allow you to work with a spot…(the Laplacian has already been used for other applications).
To note that for “Non-local means” the minimum RT-spot size is 150*150 pixels which nevertheless is very small

How is it implanted here ?

I choose to be able to be used in conjunction with ‘Luminance denoise by level’ or on its own.

I also chose to be able to use all the particularities of LA : Scope (deltaE), Transitions, Excluding Spot, Mask and ‘Recovery based on luminance mask’, and of course for one or several RT-Spot or working in « Full image »

The GUI has been modified as a consequence, in particular by changing the selection combobox. It now offers 4 choices :

  • off
  • conservative
  • aggressive
  • Non-local means only

This modification could lead to difficulties with some pp3 - in this case it is better to clean the cache

« Non local means » is enable when slider « strength » is > 0.

Labels and tooltips have been improved with the participation of Wayne Sutton @Wayne_Sutton , thanks to him.

What memory usage and processing time ?

For memory, whatever the settings, the consumption is low, thanks again to Alberto and Ingo.

For processing time, here some comparisons (output TIF)

Image 4312 * 2860 (wavelet - conservative)

Full image : wavelet 3000ms – Nlmeans 3000ms

Spot 1200*800 wavelet 260ms – Nlmeans 220ms

Spot 150*150 wavelet 100ms – Nlmeans 20ms

Image 6000*4000 (wavelet - conservative)

Full image : wavelet 12000ms – Nlmeans 6000ms

What results ?

Like all noise treatments, the result is quite subjective and depends on individual taste. But personally I find the results very good, especially in conjunction with wavelet and DCT.

======
In the same manner Rawpedia is update
https://rawpedia.rawtherapee.com/Local_Adjustments#A_complex_noise_reduction_problem:_how_to_differentiate_between_uniform_areas_and_areas_with_texture_or_detail.3F

Jacques

6 Likes

Hi all
I announce that following the request of many users, the code of “Local Adjustments” (LA) has been moved from “after RGB process” to “before RGB process”. This means that all RGB process algorithms (channel mixer, tone curve, highlight, shadows, RGB and HSV curves, Color toning, Film simulation, black and white,…) are executed after “LA” and therefore have no influence on “LA”.

The impact on the current usage is small, otherwise a slight slowdown in the execution of the zooms in preview mode.

Commit dev 7 february 2021 - d369efb

Jacques

3 Likes

This is quite a big change in operation, so let me just add the following. There are probably just as many pros and cons for this change and not everybody may like it. You are now required to make your local adjustments before some of the commonly used global tools and you cannot make local adjustments afterwards.

2 Likes

It is true. But nothing forbids to retouch “LA” after the other treatments. This is true for all RT treatments and processes as well as for all software in the world…

jacques

But Jacques, because of the dE spot behavior, doing a local adjustment afterwards is actually very different now. Because what you see is not what you get because of the order of the pipeline.

No differences at all :slight_smile:
But it’s obvious…everything that is done before is not altered by the treatments afterwards.
Except if you change the settings

But I repeat as all treatments

Jacques

@jdc I’m not understanding why you say no differences at all, sorry. People should be very aware of where LA is placed in the pipeline to have a meaningful editing experience. The effect of the LA tools are relative to the chosen spot. When you cannot see on which color/tone you put the spot, you have no reasonable reference to what you’re editing.

If somebody currently has a workflow where they like to play with curves and color toning and only then decide they want to make a local adjustment, they run into this unpredictable behavior. The color under the LA spot they place is not the color that the LA tools uses as input, because it has been changed afterwards. I think people need to be aware of this.

The deltaE “upstream” now allows to maintain the “settings” (contrast, saturation, …) on the selected area. Fortunately it is kept. That’s the goal.
That the final colors / contrasts / etc. are changed by the downstream treatments… it’s obvious, but it’s that the user wants it…For example black and white…But now BW does not suppress deltaE…

But, the settings made “upstream” remain… This is the goal, the purpose of having moved this treatment.
For me, everything works properly

jacques

Okay, I’m confused. Does this mean that all of my usual Exposure, Highlights and Shadows, Tone Curve and Lab Adjustments are now supposed to be done after LA are completed?

@stuntflyer

Yes, but this was already the case for the “Lab adjustments”.

But No, you can used “exposure, Highlight, shadows…”, etc…independently of LA…
When you change these process, no incidence on LA…
it is the same for any process upstream of "exposure, highlight…) (demosaicing, white balance, etc.). You are not “obliged” to change these processes to retouch “exposure”.

But with the Rawtherapee pipeline, it’s a choice, either before RGB process or after…As there were a lot of requests for before, which I think is globally preferable :slight_smile:

Jacques

Yes, this was the choice that was made recently. Please see Placement of local adjustments in the processing order · Issue #6069 · Beep6581/RawTherapee · GitHub for some background discussion.

@stuntflyer I think everyone is at cross-purposes here. From a user point of view you can make local and global adjustments when you like as per your normal workflow. The only thing that changes is where the Local Adjustments occur internally in the processing pipeline.
HTH

That’s the point. You have to know at which point in the pipeline local adjustments are applied, because that can have a massive impact on what you think your local adjustment spot (which is a central concept of local adjustments in RT) picks up…

5 Likes

If I understand correctly global adjustments could change the masks before which isn’t the case any more. I like it.

1 Like

It would be helpful to see a photo retouch video with voice which incorporates LA and global adjustments using the Desmis’s changes. Is that possible?

That’s certainly possible. But not from me, as I’m not a LA specialist at all.

1 Like

If I remember correctly @Andy_Astbury1 did a couple of Local Adjustment video’s a few months back. Maybe he’s able/wiling to have a look at this and make one of his nice video’s, he did ask the RawTherapee community for suggestions he could do.

No pressure, just putting this out there :slight_smile:

3 Likes

Yeah, he was asking about what to do next. This might be something of interest to him.

I don’t know how to make a video, moreover my english is very very bad, but maybe @Andy_Astbury1 can spend some time there

I just open a Pull-request
https://github.com/Beep6581/RawTherapee/pull/6099

Now, process after “LA” are neutralize (provisory) when the user uses one of the functions “Preview deltaE”. Up to now only BW was concerned by this behavior.

So we can see the impact of LA without the action of downstream processes

jacques

There is no AppImage since Feb 21 on the nightly builds download page. But I guess the new changes are already in the newest Windows build?