Beep6581 / RawTherapee

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

capture sharpening creates double lines #6094

Closed ff2000 closed 3 years ago

ff2000 commented 3 years ago

I really like how capture sharpening can recover crisp details in many shots. Unfortunately with contrasty edges it tends to produce double lines. E.G. shooting a branch against white snow: Screenshot_20210205_101720 As I shoot a lot of HighRes now with my OLY I need the power of Capture sharpening to fix the general blurriness of the RAW files... Screenshot_20210205_102248

I can reduce that effect by dialing down the radius and/or the iterations, but it also greatly reduces the sharpness of the resulting image.

Thanatomanic commented 3 years ago

I believe this comes down to: for any automagic tool, you have to make a compromise somewhere. The automatic radius finds a value that is pretty large (> 1 px) which results in an overshoot of the sharpening and a darkening of edges. This is a known result of the underlying sharpening algorithm. Unless @heckflosse says otherwise, I think the only thing that we might do here, is fine-tune the automatic radius code a bit. The algorithm itself is sound.

ff2000 commented 3 years ago

This is with a small diameter (0.6): Screenshot_20210205_120412 RAW file: https://www.dropbox.com/s/vkdki4i9f6i03nq/P2010311.ORF?dl=0

HiRes with 0.85: Screenshot_20210205_121039 RAW file: https://www.dropbox.com/s/ife1579nxmc78b6/P2010323.ORF?dl=0

I do not think it entirely is the fault of the radius. As it looks to me I have a gradient getting lighter towards the bright snow. CS enhances the overall contrast of that gradient, but also sees the edge of the trunk and creates a strong contrast leading to a black line between the snow and the trunk.

TechXavAL commented 3 years ago

It seems to me that a big part of this problem comes from the Iterations set.

By default there are 20 iterations and auto-limit is turned on. Even if usually this is all you need, there are situations (and I think this is one of them) where you may wish to lower that number to something between 8 and 12 (by trial and error).

Think about iterations as sharpening the sharpened image a number of times: the artifacts are quickly piled on top of previous ones, making them too obvious.

You may have to do this at the same time as lowering radius enough to prevent oversharpening (white and/or black haloing, and too obious jagged lines).

With really difficult images you will have to check again and again until you find a sweet spot.

HTH.

heckflosse commented 3 years ago

@ff2000 Can you provide a raw? I would like to test something...

Thanatomanic commented 3 years ago

@heckflosse The last post with images contains links to the RAW files

heckflosse commented 3 years ago

Oh, must have been blind :-(

ff2000 commented 3 years ago

The second post contains links to RAW files. Here is the RAW file from the first post: https://www.dropbox.com/s/jnjbccyxsguicme/P1120122.ORF?dl=0 And the Non-HighRes .ori file: https://www.dropbox.com/s/3ijp8wvsny68hoi/P1120122.ORI?dl=0 Might be interesting as it was a quite foggy day and the tree is covered in snow and fog (hence generally little sharpness), also it shows the strongest halo.

Here is another one that shows the effect inverted: Screenshot_20210205_180126 https://www.dropbox.com/s/2u53uktqcp9qqog/P2010332.ORF?dl=0 And pp3: https://www.dropbox.com/s/1dbxtfr7rki8ot8/P2010332.ORF.pp3?dl=0

heckflosse commented 3 years ago

Might be interesting as it was a quite foggy day

That's the point. The fog confuses the radius auto-calculation. Using the poor_man_dehaze branch you see 3 black levels in console when opening a raw. If you set them in gui, you get a much better radius auto-calculation for this foggy shots.

grafik

heckflosse commented 3 years ago

Just for fun another example what you can get by using the poor_man_dehaze black levels on hazy shots. Distance to subject was about 7 to 10 km. Left neutral profile, right with poor_man_dehaze black levels grafik

TechXavAL commented 3 years ago

@heckflosse : I can't wait for this tool to be merged into dev :smile:

@ff2000 : those are my attempts with other CS settings. I've applied a heavy defringing, too. Adjust contrast and lightness to taste.

P1120122 P1120122.jpg.out.pp3.zip

P2010311 P2010311.jpg.out.pp3.zip

P2010323 P2010323.jpg.out.pp3.zip

P2010332 P2010332.jpg.out.pp3.zip

I was more interested in good CS settings, as it seems to be your doubt, but most probably I would have fully processed those images differently. Anyway, hope it helps.

ff2000 commented 3 years ago

Might be interesting as it was a quite foggy day

That's the point. The fog confuses the radius auto-calculation. Using the poor_man_dehaze branch you see 3 black levels in console when opening a raw. If you set them in gui, you get a much better radius auto-calculation for this foggy shots.

grafik

The only foggy shot was P1120122.ORF - all other shots had the tree surrounded by absolutely no fog, subjects stood clear in the field. And I do not want to get rid of the fog by dehazing. The High Res Shots generally look a bit foggy/hazy. It's 80MP due to the Algo (shifting/blending 8 shots), Oly somewhere states that one should scale them down to 40/50MP. And after that (with proper sharpening) the images IMO look great. (I just mention this in case the appearance confused you).

It took me some time now to test the suggestions due to limited time on my dad's PC. And as I already saw before limiting radius/iterations reduces the sharpening to an amount that is barely visible. As I already said I love how CS can pull out details, everything about it in these shots is great, it's just with these single high-contrast branches where it produces Halos.

As it seems this is a corner case I will now just make 2 conversions and blend them in Gimp.