Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.79k stars 316 forks source link

Noise Reduction preview at 100% does not match saved image #3895

Open JamesForBugReport opened 7 years ago

JamesForBugReport commented 7 years ago

Version: 5.1 Branch: 5.1 Commit: f23d70fd Commit date: 2017-05-15 Compiler: gcc 6.3.0 Processor: generic x86 System: Windows Bit depth: 64 bits Gtkmm: V3.22.0 Build type: release Build flags: -m64 -mwin32 -mthreads -Werror=unused-label -Werror=unknown-pragmas -Wno-aggressive-loop-optimizations -std=c++11 -mtune=generic -Werror=unused-label -fopenmp -Werror=unknown-pragmas -Wall -Wno-unused-result -Wno-deprecated-declarations -mwindows -DNDEBUG -msse2 -O3 Link flags: -m64 -mthreads -static-libgcc -mtune=generic -mwindows -s -O3 OpenMP support: ON MMAP support: ON

Windows 10 Home 64-bit Intel Core i5 63000U @ 2.3 GHz 8GB RAM

RawTherapee downloaded from http://rawtherapee.com/releases_head/windows/RawTherapee_5.1_WinVista_64.zip

I'm afraid I do not have the exact steps, I was editing another users file from pixls a couple of weeks back and noticed the issue with the non-resized output. I waited until now to reproduce with latest version.

Using the Raw file from here https://discuss.pixls.us/t/how-to-process-night-sky-shot-with-nikon-nef/4176 with this pp3 DSC_2391.NEF.pp3.txt

Viewing the preview at 1:1 does not match the output at 100%. Specifically look at the bottom left corner, the output has lots of white pixels which are not displayed in the preview. I have tried saving output as jpg or tif and opening with multiple 3rd party file viewers.

1to1 preview output mismatch

with Retinex turned off, the preview is much closer, but there are still some white pixels in the output that do not appear in the preview.

1to1 preview output mismatch no retinex

Regards,

James

Beep6581 commented 7 years ago

Why are you filing a bug report about Retinex when you have Wavelets, Tone Mapping, Sharpening, Noise Reduction etc etc turned on? Isolate the problem to a single tool with all the rest turned off.

Beep6581 commented 7 years ago

I isolated all the irrelevant tools. I can reproduce the problem of the preview not matching the saved output at 100% using only Sharpening and Noise Reduction, but using other tools can make that problem more clear (or they can mask it). Minimal PP3: DSC_2391_minimal.NEF.pp3.txt

Wavelets > Denoise & Refine is enabled in this PP3 to amplify the problem, but the problem still there if you disable it. If you set Level 1 Denoise to 0, the preview resembles the saved image more; if you set Level 1 Denoise to 100 the preview is very different to the saved image.

JamesForBugReport commented 7 years ago

OK, fair enough.

I have tested many combinations of the tools in this pp3, it is already looking like a complex relationship. I suspect that some tools are amplifying minor issues with others. For example, with all tools from the pp3 enabled, apart from the ones specified

So the cuplrit looks like "wavelet denoise and refine", only that with all tools off except chrominance nr and "wavelet denoise and refine", there is also no difference between preview and output.

I am comparing by eye, not by pixel values.

I was writing this as your last response appeared, we have come to similar conclusions.

agriggio commented 7 years ago

Hi @JamesForBugReport, would you be able to try with the branch wavelet-contrast-accurate-preview and see whether that helps? (see also the discussion in #3793)

JamesForBugReport commented 7 years ago

Hi @agriggio I do not have a build environment, is there a windows binary available? I searched the thread but couldn't find a link.

agriggio commented 7 years ago

@JamesForBugReport sorry, I have no windows build env. I'll try to test on Linux and post a screenshot, let's see if the above branch makes things better

Beep6581 commented 7 years ago

Hello @agriggio

I tested wavelet-contrast-accurate-preview but it does not solve the issue: imgur-2017_05_29-17 23 59

agriggio commented 7 years ago

@Beep6581 sorry, I misread the info provided. I thought the culprit was wavelet noise reduction, but in fact it seems to be the "regular" noise reduction instead. In that case, a possible solution is to apply the same trick used for wavelet in the wavelet-contrast-accurate-preview branch also to the normal noise reduction.

EDIT the trick shouldn't be too hard to implement in principle. In practice, I think we should consider a more general code refactoring to unify the various processing pipelines. I'll open a separate issue about that.

JamesForBugReport commented 7 years ago

Sorry @agriggio the confusion was caused by me. @Beep6581 was approaching from a point of enabling minimal tools that caused the issue, I was approaching from turning off tools to remove the issue. I reported that with Wavelet Denoise and Refine turned off there was no difference, on second inspection, there is still a difference. Upon further testing, I concur with @Beep6581 findings that noise reduction plus sharpening is the real culprit, which is massively exaggerated by wavelet define and renoise level 1 set to high values.

JurajMa commented 4 years ago

This problem is still there, in RawTherapee 5.8, Windows, as downloaded from the main website.