Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diffuse and sharpen: add local contrast fine #16194

Conversation

wilecoyote2015
Copy link
Contributor

@wilecoyote2015 wilecoyote2015 commented Jan 27, 2024

Hello all,

Back then with the display-referred workflow, I tended to use the local contrast module quite often when mapping scenes with high dynamic range.
Although the diffuse and sharpen module comes with a preset do increase the local contrast, it often yielded inferior results in my use cases because it emphasizes lower frequencies and also tends to crush large, dark areas to black.

This new preset is the base I currently use for increasing local contrast.
It focuses more on the enhancement of fine to medium structures, and hence resembles (at least in my perception) something like "clarity" more closely than the standard preset.
Due to the accentuation of finer textures, I called this "local contrast fine".
The strength can be adjusted easily by the diffusion strengths of scales 1 and 4 and also via the number of iterations.

Comparison (order: without local contrast, with new preset, with normal local contrast preset).
The difference is probably hard to spot side-by-side. Notice the emphasis of the texture in the bottom left area.
DSCF2035_raw)
DSCF2035_lc)
DSCF2035_lc_default)

local_contrast_fine.zip

@TurboGit TurboGit added this to the 4.8 milestone Jan 27, 2024
@TurboGit TurboGit added feature: enhancement current features to improve scope: image processing correcting pixels labels Jan 27, 2024
@TurboGit
Copy link
Member

@wilecoyote2015 : Indeed, nice... I do see the fine details in dark areas whereas the other local contrast presets have a tendency do darken out them too much.

@TurboGit
Copy link
Member

@wilecoyote2015 : Please never merge master in a topic branch. Also I see that you've changed the preset values, can you describe why has changed visually? What was the goal of this improvement? TIA.

@wilecoyote2015
Copy link
Contributor Author

Sorry, thank you for bringing that up.
The motivation for the change of preset values are explained briefly in the commit message.
In further testing, I noticed that the initial commit's values could yield ringing artifacts on high-contrast edges. Furthermore, small dark areas could produce a dark halo. The latest commit compensates for that.
There is no visual difference in the example image.
I plan no further adjustments, so that the current version is considered final.

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this new version very very subtle doing change only on fine details, probably what is wanted here but just wanted to be sure I'm not missing something.

src/iop/diffuse.c Outdated Show resolved Hide resolved
@wilecoyote2015
Copy link
Contributor Author

wilecoyote2015 commented Jan 29, 2024

I found this new version very very subtle doing change only on fine details, probably what is wanted here but just wanted to be sure I'm not missing something.

That is strange. I have double checked that the parameters of the preset are correct.
In the comparison below (100% crop), the differences are quite evident.
Increasing the strength further by increasing iteration count or diffusion parameters tends to yield an overprocessed, HDR-Like look, so for increasing "clarity", at least for my pictures, this seems to be the sweet spot for me.
In particular, the local contrast: fine preset emphasizes the the texture stronger than the local contrast preset.
(Order: raw, local contrast: fine, local contrast)
DSCF2016_raw
DSCF2016_lc_fine_new
DSCF2016_lc_default

Edit: A comparison for a more realistic use-case (enhancing the bark texture), with raw on top:
DSCF2036_small_raw
DSCF2036_small_lc

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit merged commit 8dcc29d into darktable-org:master Jan 29, 2024
5 checks passed
@tpinfold
Copy link

tpinfold commented Feb 6, 2024

Great preset. I just quickly checked it in the weekly windows build. I wonder if the name clarity would be more appropriate to let users know what it does best?

@wilecoyote2015 wilecoyote2015 deleted the wilecoyote2015-local-contrast-fine branch February 7, 2024 19:11
@elstoc elstoc added the documentation-pending a documentation work is required label May 12, 2024
@elstoc elstoc removed the documentation-pending a documentation work is required label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: enhancement current features to improve scope: image processing correcting pixels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants