Beep6581 / RawTherapee

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

Occasional dark image output with RL Deconvolution #1231

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1246

When RL Deconvolution AND Edges are both enabled, AND the number of iterations for RL
Deconv is set to any value but the default of 5, the output image is rendered very
dark, and the colours distinctly mis-saturated (screenshot and PP3 attached).

Version Info:

Branch: default
Version: 4.0.7.1
Changeset: 6deebb547be6
Compiler: GCC 4.6.1
Processor: generic x86
System: Windows
Bit depth: 64 bits
Gtkmm: V2.22.0
Build type: RELEASE
Build flags:  -mtune=generic -O2 -DNDEBUG
Link flags:  -mtune=generic -mwindows -s -Wl,--large-address-aware
OpenMP support: ON
MMAP support: ON

Operating system:

Windows Vista 32-bit; 4GB physical RAM; 3GB-flag set

Link to raw file:

http://dl.dropbox.com/u/30043274/RT/P1239942.ORF

Reported by TFTAJLLYMXZP@spammotel.com on 2012-02-09 04:02:40


Beep6581 commented 9 years ago
Sorry.  Wrong PP3 attached to bug report.  Replaced with PP3 attached here.

Reported by TFTAJLLYMXZP@spammotel.com on 2012-02-09 04:12:09


Beep6581 commented 9 years ago
"the number of iterations for RL Deconv is set to any value but the default of 5"
5 is not the default for any of the profile packaged with RT.

grep "DeconvIterations=" rt_default_release/profiles/* | column -ts ":"
rt_default_release/profiles/BW-1.pp3                DeconvIterations=30
rt_default_release/profiles/BW-2.pp3                DeconvIterations=30
rt_default_release/profiles/BW-3.pp3                DeconvIterations=30
rt_default_release/profiles/BW-4.pp3                DeconvIterations=30
rt_default_release/profiles/default-ISO-high.pp3    DeconvIterations=30
rt_default_release/profiles/default-ISO-medium.pp3  DeconvIterations=30
rt_default_release/profiles/default.pp3             DeconvIterations=30
rt_default_release/profiles/Highkey-1.pp3           DeconvIterations=30
rt_default_release/profiles/Natural-1.pp3           DeconvIterations=30
rt_default_release/profiles/Natural-2.pp3           DeconvIterations=30
rt_default_release/profiles/neutral.pp3             DeconvIterations=30
rt_default_release/profiles/Punchy-1.pp3            DeconvIterations=30
rt_default_release/profiles/Punchy-2.pp3            DeconvIterations=30

Doing as you described, and using your profile, I could not get that behavior for any
photo, including the one you provided. Linux here, 4.0.7.5.

Can you reproduce that with other photos?
If you can, please start off with the neutral profile, and just do what you described
above. Does it still turn dark and funky?

Reported by entertheyoni on 2012-02-10 21:02:56


Beep6581 commented 9 years ago
What is that red frame around your screenshot(?)?

http://i.imgur.com/JYQiF.jpg

Reported by entertheyoni on 2012-02-10 21:35:21

Beep6581 commented 9 years ago
I get the same problem, also on W32. I get it when I use the neutral profile and combine
edges and RL deconvolution with no other adjustments whatsoever. Either on their own
work fine, it is just the combination of the two. It looks to me as much like a bad
overlay blend than anything else.

Reported by accountingfgc on 2012-02-11 03:08:56

Beep6581 commented 9 years ago

Reported by entertheyoni on 2012-02-11 22:03:59

Beep6581 commented 9 years ago
Szal in IRC has confirmed this:

2012-06-16 02:56:53     szal    reproduced w/ one of my RAW files, preview shows correctly,
output file is pitch black
2012-06-16 02:57:09     szal    RT 4.0.9.1, W64
2012-06-16 03:16:37     szal    ok, I did 3 runs w/ a previously unedited RAW file
from my Nikon D50, one w/ my custom-made D50 profile + Edges (changed number of iterations)
+ RL Deconv sharpening, one each w/ both neutral profiles I can select ("neutral" (left
over from an earlier RT version, I suppose), and "Neutral") + Edges + RL Deconv sharpening,
both w/ default values.. in all 3 cases the exported image is all black

2012-06-18 19:02:48     szal    checked the RL reconv sharpening again w/ 4.0.9.15;
still there, though this time the image didn't come out black but severely underexposed

Reported by entertheyoni on 2012-06-18 18:18:41

Beep6581 commented 9 years ago
I'm seeing this repeatedly with the latest build (compiled on 25/06/2012),apparently
related to the combined use of RL deconvolution (with iterations values higher than
30) and edges sharpening,output image is totally different from preview,much darker
and in some cases almost totally black.I will add more details and provide pp3 files
ASAP.

Reported by msth67 on 2012-06-26 10:25:12

Beep6581 commented 9 years ago
Well it's apparently more complicated than that:on this particular attached image,RL
deconvolution alone with the settings stored in this pp3 file generates this extremely
dark output which is totally different from the preview (see attached screenshot):no
edges sharpening was involved,and then just switching from RL deconvolution to Unsharp
Mask gives the expected output matching the preview.On the other hand,Tone Mapping
possibly combined with edges also produces a very similar issue on some images,without
RL deconvolution being involved at all.

Branch: default
Version: 4.0.9.36
Changeset: cda5680cdce1

Linux ubuntu-desktop 3.0.0-20-generic #34~lucid1-Ubuntu  x86_64 GNU/Linux

Raw file : http://www.sendspace.com/file/36buhx

RT preview screenshot : http://imgur.com/dX49e

dark image output : http://imgur.com/irIwx

Reported by msth67 on 2012-06-26 17:12:49


Beep6581 commented 9 years ago
I guess that this issue deserve a higher priority?

Reported by natureh.510 on 2012-07-01 17:18:02

Beep6581 commented 9 years ago
Please try again using the latest builds: 4.0.9.58 1946:ef748b4553fe or newer.
Remember to first delete your cache.

Reported by entertheyoni on 2012-07-02 19:38:24

Beep6581 commented 9 years ago
Tested with build 4.0.9.59 Changeset 4b0418035d7b,the issue is no longer reproducible:raw
file linked in comment 8  is now correctly processed with the attached pp3 file,also
other images affected when using RL deconvolution with iteration values higher than
30 combined with edges sharpening are now correctly processed.

Reported by msth67 on 2012-07-04 20:11:27

Beep6581 commented 9 years ago
Tested with latest W32 binaries:
Branch: default
Version: 4.0.9.50
Changeset: ca684d56e7d7
Compiler: GCC 4.6.1
Processor: generic x86
System: Windows
Bit depth: 64 bits
Gtkmm: V2.22.0
Build type: RELEASE
Build flags:  -mtune=generic -O2 -DNDEBUG
Link flags:  -mtune=generic -mwindows -s -Wl,--large-address-aware
OpenMP support: ON
MMAP support: ON

Cleared cache with "Clear All" in Preferences, but the problem of pitch black output
persists when starting with Neutral, then adding only RL Deconv (defaults), and Edges
(defaults).  Failed output files are an order-of-magnitude smaller than successful
output files: ~80 KB vs. ~55 Mb.

The raw file can be downloaded here:

  http://dl.dropbox.com/u/30043274/Issue20120707/P7030579.ORF

The filenames of the three attached PP3 files indicate the settings they contain.

Terry

Reported by TFTAJLLYMXZP@spammotel.com on 2012-07-08 00:03:15


Beep6581 commented 9 years ago
It seems that even with the latest 4.0.12.61 (built from source on an up-to-date ArchLinux)
the issue persists on any RAW image opened with the `(Neutral)` profile set as the
default.

At the following link you can find an example RAW image, and the two PP3 plus the resulting
JPEG.  The `diff` between the two PP3 is just an `Enable=true` for the sharpening with
RL-Deconvolution.  As settings I've used the following (if I remember correctly): crop,
resize, camera profile, custom white balance, Lab adjustments.

  http://data.volution.ro/ciprian/665371e6adeefdbb704aea9ed29f10e7/01

However if I just apply the `(Neutral)` profile, and I don't touch anything (except
applying RL-Deconvolution) it works.

Reported by ciprian.craciun on 2014-03-03 19:14:02


Beep6581 commented 9 years ago
Tried with your files. Works fine here.

Ingo

Reported by heckflosse@i-weyrich.de on 2014-03-03 19:34:27

Beep6581 commented 9 years ago
Actually I've traced the issue down to the Lab "CC" slider (Chromaticity according to
chromaticity), which combined with RL-deconvolution enabled and the following settings
give:

 * totally black image:

ccCurve=2;0.050000000000000003;0.20000000000000001;0.57999999999999996;0;100;-25;-50;

ccCurve=2;0.050000000000000003;0.20000000000000001;0.57999999999999996;0;98;-25;-50;

Thus with RL-deconvolution enabled the difference between 100 (black output) and 98 (correct output) in the "Pastel" slider makes or breaks the image. But as stated in the previous comment, even with the 100 value, but without RL-deconvolution enabled, the images is OK. (I've tested these settings a couple of times.)

However I've noticed something strange: when the slider for "Pastel" is at 100 or even 99, there is a spike in the curve, which seems to disappear at 98.


Reported by `ciprian.craciun` on 2014-03-03 19:46:01
Beep6581 commented 9 years ago
RL-deconvolution enhances the effect of nan-values. If there is a nan value in your
picture caused by any of the tools which are called before RL-deconvolution, then it
will be spread over the whole image or at least parts of the image, depending on the
radius and the number of iterations.

Ingo

Reported by heckflosse@i-weyrich.de on 2014-03-03 20:05:01

Beep6581 commented 9 years ago
I applied neutral to your DNG, then enabled RL and the CC curve using your parameters.
Saved the image to an 8-bit TIFF, it looks fine.
Next I applied your nok-_igp6627.jpg.out and saved again, still fine. http://i.imgur.com/89UfLZq.jpg
Cannot reproduce in Gentoo 64-bit.

Please restart RawTherapee, do not open the file yet, from the File Browser right-click
on that DNG and select "Clear from cache - full" and then "Processing Profile Operations
> Apply > (Neutral)", then open it, enable RL Sharpening and the CC curve, and save
the image. Is it black? If so, send us this new PP3 and paste your AboutThisBuild.txt
contents.
After applying Neutral, be sure to not touch anything other than enabling RL and the
CC Curve.

Reported by entertheyoni on 2014-03-06 11:59:20

Beep6581 commented 9 years ago
A small observation: I'm running a 32-bit build of RawTherapee.

So I've tried exactly what you've described:
* restarted RawTherapee;
* cleared the cache (full) for that photo;
* cleared the profile;
* cleared again the cache (full);
* apply neutral;
* open the photo and only apply CC Curve and RL Deconvolution;
* add to queue and process;

Indeed the photo looks OK (i.e. non-black).  However I've tried once more my `nok-_igp6627.jpg.out.pp3
` profile, just to be sure, and it still results in a black image.

Moreover I found the only extra option that generates the black image:
* (apply all the clear and neutral);
* apply the CC Curve with values (from `Neutral` to `Saturated`): 0, 100, -25, -50;
* enable the RL Deconvolution;
* change the white balance to `Custom` with value 5750K, and 1 for the tints;
* build, and a black image results; (as exported to JPEG 8 bit, 100% JPEG Quality,
Best Quality for subsampling;)

See attached the faulty PP3 and the `AboutThisBuild.txt`.

Reported by ciprian.craciun on 2014-03-09 11:09:18


Beep6581 commented 9 years ago
I tried using your steps as well as using your PP3, and in both cases it saved fine
http://i.imgur.com/Yw0pM7X.jpg

Branch: default
Version: 4.0.12.68 2275bw3
Changeset: 8e7f623bcf89
Compiler: cc 4.8.2
Processor: undefined
System: Linux
Bit depth: 64 bits
Gtkmm: V2.24.4
Build type: Release
Build flags:  -Wno-unused-result -Wno-aggressive-loop-optimizations -march=native -fopenmp
-Werror=unknown-pragmas -O3 -DNDEBUG
Link flags:   -march=native
OpenMP support: ON
MMAP support: ON

I heard RT doesn't work on Windows with GCC-4.8 but you are using just that, so maybe
that's the problem... could someone confirm?

Reported by entertheyoni on 2014-03-09 21:28:21

Beep6581 commented 9 years ago
DrSlony, his AboutThisBuild.txt says, he uses 32 bit Linux, not Windows...

Reported by heckflosse@i-weyrich.de on 2014-03-09 21:31:38

Beep6581 commented 9 years ago
Oh right! I was used to this being a windows-thing as the previous AboutThisBuilds indicated
that.

Reported by entertheyoni on 2014-03-10 10:50:54

Beep6581 commented 9 years ago

No files available to try and reproduce, expired.