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
New shadows/highlights implementation #4506
Conversation
The results look good, looking forward to trying it. Could you explain how it works? |
I'll try to post a video of how to do more or less the same with GIMP (using layers and masks, and working in lab mode). the code basically automates the manual way (plus some tweaks here and there to try to keep artifacts under control) |
like it 👍 |
Here is an explanation video and a raw to play with: |
I was never able to get acceptable result with previous S/H tool. For what I tested this version is better |
I have added the Hopefully this will allow more people to test this cool feature! |
@agriggio I found an inconsistency: Apply neutral profile: Radius of Sh/Hl is set to 40 |
@heckflosse thanks for the review! about the reset bug, I thought I fixed it already but perhaps I forgot to port it from my playground to the branch... I'll check again |
@agriggio I prepared a speedup for the generation of the |
Sorry, my fault as well... |
@heckflosse Ingo, feel free to push your fixes and speedups directly 👍 |
No problem for the new tool :) |
I didn't have time to test, so I'll abstain. |
@agriggio Done! Also merged dev into this branch. |
Would it be possible, and would there be any interest, in adding a way of controlling what is considered a shadow and what a highlight? For example, I want to see inside the engine, but not touch the red paint which is already near clipping: http://rawtherapee.com/shared/test_images/tracteur.dng This is only a question/discussion, not a feature request yet, because HDR Tone Mapping lets me do just that: |
@Beep6581 you can try playing with the "tonal width" sliders to restrict the effect (pull down for shadows, or push up for highlights). However, this picture is particularly tricky as the shadows have very sharp edges, and it's very easy to get halos with the gaussian blur that is currently used. |
I don't know if it's helpful or not, but just in case i'm uploading a result from lightroom + clip in the link provided. If you want me to process some more photos this way (for references purpose) let me know. |
Thank you @kazah7 , nice and smooth. |
thanks @kazah7, I think the hdr tone mapping tool could help in getting close. I'll try later if I find some time... |
And my attempt Using HDR tone mapping with additionnal contrast. |
Hi all, is there anything missing before merging this? Is the current quality/functionality good enough? One thing that comes to my mind is how to deal with pp3's that were using the old version of the tool. Given the large differences between the two outputs, my proposal would be to simply disable the new S/H tool for old pp3's. What do you think? |
No foreseeable requests from me, looking forward to the merge. |
Should we add some default settings for sh/hl? Currently, when a user enables the tool, nothing happens, because the settings are zero. Just an idea... I know it was the same with the old sh/hl tool |
I think the defaults for radius and tonal ranges are reasonable. regarding the amounts, I can't think of anything sensible that will give good results across different pics -- it's just too dependent on the contents of each pic IMHO |
ok |
I have a question on those openmp usage. Is is, that with current implementation, each call for omp parallel for creates a bunch of new threads without any limitations? As I remember, openmp on *nix does not use any thread pool for execution. Might be that this is not a problem, but it can be solved with thread teams. |
@lvreclp
Usually the number of threads is limited by the number of cores on your machine. Can you be a bit more specific about the problem? |
@heckflosse Or you can limit thread count by using next construction: #pragma omp parallel for num_threads(4) |
@lvreclp maybe OMP_NUM_THREADS environment variable was set wrongly? https://gcc.gnu.org/onlinedocs/libgomp/omp_005fget_005fnum_005fthreads.html |
The current shadows/highlights tool is really not my cup of tea. I never managed to get good results with it. So, I started experimenting with an alternative implementation. I kept the same UI (except for the "sharp mask" checkbox, which is now useless so it's gone) but I changed completely the implementation. I actually have no idea how the old code worked, I developed the new tool completely "from scratch" (but it's really simple, so probably it's nothing new).
This PR is a proposal to get rid of the old implementation and use the new one. However, since this is not backwards compatible (the results are quite different with the new tool), I won't fight for it -- if you prefer to keep the old tool, no problem, I will keep this in my own (private) fork of RT.
Anyway, here is a little demo for the interested people (all images start from the "Auto Matched Tone Curve - ISO low" profile, and I only play with the new S/H tool).
https://filebin.net/jivbz36z4mn8aze6/sh.mp4