Page 1 of 2

Faster Bilateral Sharpening

Posted: November 9th, 2021, 4:40 pm
by jsachs
For quite a while now I have been looking for a way to speed up bilateral sharpening which I use as my main sharpening tool and which is usually the slowest step by far in my processing workflow. I'm not sure how many of you use this transformation, but I recently added to its description in Transformations.pdf and plan to expand this further with more examples in the future to give more tips on how the get the most out of it.

Anyway, I ended up corresponding with the author a paper on fast bilateral filtering and he kindly pointed me to a more recent technique called guided filtering that produces similar if not better results than bilateral filtering and which can be implemented much more efficiently, especially for large radius settings. I have been experimenting with guided filtering and so far the results look very good, so expect this method as an option in Bilateral Sharpen very soon. For backward compatibility with existing scripts, I will retain the original bilateral filter method since it produces slightly different results, but I recommend using the guided filter method going forward and will make it the default for new transformations. Existing scripts will still reference the bilateral method until you change them explicitly.

Re: Faster Bilateral Sharpening

Posted: November 9th, 2021, 4:53 pm
by MarkT
Interesting, looking forward to trying this out.

Re: Faster Bilateral Sharpening

Posted: November 9th, 2021, 8:33 pm
by pierrelabreche
I was justly reading about bilateral sharpening in transformations.pdf. I certainly will try it !

Re: Faster Bilateral Sharpening

Posted: November 10th, 2021, 10:43 am
by tomczak
In a nutshell, how different is this new technique from BS, other than speed?

Re: Faster Bilateral Sharpening

Posted: November 10th, 2021, 12:25 pm
by jsachs
The results are very similar -- I have not investigated thoroughly, but the Guided is supposed to reduce certain artifacts that show up when sharpening smooth gradients using Bilateral.

Re: Faster Bilateral Sharpening

Posted: November 11th, 2021, 4:13 am
by tomczak
Out of curiosity, I just started reading about the Guided filter - I imagine it is the same or similar technique to the one that Jonathan is implementing. I figured I'd share the link to a slideshow that illustrates the technique:

http://kaiminghe.com/eccv10/eccv10ppt.pdf

In addition to the math of it, there are visual examples and comparisons to the Bilateral filter using photographic images.

Re: Faster Bilateral Sharpening

Posted: November 11th, 2021, 7:39 am
by jsachs
Yes, that is the primary journal article on guided filtering.

Re: Faster Bilateral Sharpening

Posted: November 11th, 2021, 9:57 pm
by Charles2
Bilateral Sharpen is my preferred method of adding local contrast or what DxO PhotoLab calls microcontrast. I usually apply after RL deconvolution sharpening at the raw stage (Raw Therapee) and sometimes a bit of Advanced Sharpening with a radius just under or equal to 1.

Screen captures show my default settings. They are not carefully worked out, just stumbled into them and I welcome criticism.

So I'll be happy to use the new method.

Re: Faster Bilateral Sharpening

Posted: November 11th, 2021, 10:31 pm
by jsachs
I do something similar as well.

Along with the modifications to Bilateral Sharpen I am about to upload a new document that goes into considerable detail about how to get the most out of it. For example, I recommend the following changes to your settings for the large blur radius pass:

1) lower the blur threshold to 5-10%
2) Increase the Sharpen Factor to 2.0
3) reduce the Blur Threshold to 0%

I also usually set the Amount slider to 100%

Re: Faster Bilateral Sharpening

Posted: November 12th, 2021, 3:42 am
by tomczak
Two questions regarding the new Guided technique:

Would it replace BS in other places where it is presently used (e.g. Brightness Curve, Adjust, and probably some others)?

Not that I understand how it actually works, but it appears that the 'guiding' image doesn't have to be the same as (or directly derived from) the image being processed. Would it be useful to consider such an option? (it's not my idea - I took it from the algorithm authors' slideshow above when they use the flash image as a guide to process the natural light image).