How to recursively sharpen using Rawtherapee?

Being somewhat new to digital image editing has me reading different articles pertaining to image sharpening to particularly include learning about use of the Unsharp Mask tool. There seems to be a prevailing thought that it can be advantageous, at least in some circumstances, to apply this tool several times using more conservative parameters rather than just once using more aggressive parameters. Some documented work-flows advocate 3 different stages of development when sharpening should be considered.

Right now it looks to me that doing this with some so-called non-destructive processors, such as Rawtherapee, might require exporting (i.e., saving) an image to another format (e.g., tif) and then using such an intermediate exported file to perform any subsequent sharpening operations.

Is this a valid/correct understanding?

I believe that is correct. The Unsharp mask can only be applied once, so far as I can tell.

It might be easier and more repeatable to export a tiff from RT and do the multi pass sharpening in gimp.

Using gimp would also open you up to using gmic to sharpen images. I really like gmicā€™s octave sharpen and richardson-lucy (I donā€™t quite remember the name off the top of my head) sharpen. As if you needed a deeper rabbit hole :wink:

Well, there are more than three sharpening tools in RawTherapee. You can apply them all in small amounts. I suppose they will act as three separate instances of sharpening. The methods are:

  1. Sharpening module in Detail
  2. Edge sharpness in Wavelet
  3. Final Touch-up module in Wavelets tab
  4. Contrast by Detail in Detail Tab

Yes. I do also use GIMP so that could be a good answer at least in some cases. Iā€™ve just now started to figure out what Unsharp Mask is about and as best I can tell, at least, some of the rationale for using recursive sharpening has to do with the concept of applying a mask. Not sure how that might apply to other techniques.

In RT you can apply UM twice, the last time just after scaling the final output image. Look under the Transform tab, Resize, then Post-Resize Sharpening.

My normal workflow is to apply minor UM to the full scale image and then moderate UM after resizing, but the amounts can vary from one image to the next.

No doubt I have more to learn when it comes to all of the available tools. However, I think the idea of recursive sharpening is about applying the same tool several times rather than just once.

IMHO, nonesense.

@ajax, if you come across a good example showing the better result of recursive sharpening versus one-off, please post details, it would be interesting to see.

My own level of experience is sufficiently limited that I have no personal opinion. However, the idea of recursively performing the Unsharp Mask operation is not something I came up with but rather came from some reading where it seemed to me that the authors new something of what they were saying.

Here is a link to one such article, which at this point has been around for quite a while, that I found via Wikipedia which says -

ā€¦ ā€œRadius: start with .5 and try to avoid going much higher, if possible. I believe itā€™s better to apply Unsharp Mask twice with .5 and .3 than using an initial radius of .8. Why? Because any value larger than .5 starts to affect more than one pixel beyond the transition point, which starts to produce more visible halos, especially if you need to use aggressive amount values. If youā€™re printing with an inkjet printer, the dot gain you get from the ink spreading on the paper often masks these halos, so go ahead and try higher values if youā€™d like, but only if you analyze the results from the final output (not the screen).ā€ ā€¦

Here is a link to another article which goes into quite a bit of detail about a 3 stage work-flow where sharpening is involved in each stage. It includes a sentence which says -

ā€¦ ā€œMost photographers now agree that sharpening is most effective and flexible when itā€™s applied more than once during image editing.ā€ ā€¦

In this case, the idea is not necessarily limited to reusing the same tool (e.g., Unsharp Mask) but Iā€™d also say that such is not ruled out. For someone just starting, I got the idea that Unsharp Mask was an important and powerful tool that represented a good starting place when it comes to learning how to sharpen images.

Here is a link to another article on the Cambridge Color website which discusses the total work-flow for digital image editing. It specifically mentions what it calls ā€œCapture Sharpeningā€ in Step 5 of 10 and ā€œOutput Sharpeningā€ in Step 10 of 10.

1 Like

Well now, that looks to be the reason I asked. I hadnā€™t noticed it also being present on the ā€œTranform Tabā€. Maybe it is worth verifying that this could be the only operation performed using that tab. In that, can Post Re-size Sharpen be done even when no resizing is done? If so, sounds like the answer is that RT can sharpen exactly twice using Unsharp Mask. This is good to know. Thanks!

Iā€™ve never head of recursive sharpening, and I donā€™t know what that might be.

On the other hand, iterative sharpening (sharpening once, then sharpening again) has an obvious explanation.

One school of thought for digital photography is that a small sharpening should be applied first to compensate for the AA filter etc, then apply dodging/burning/etc as desired, and finally resize and sharpen (perhaps as a single operation). That seems plausible.

But sharpening with radius r1 followed by sharpening with radius r2 is not at all the same thing as sharpening with radius (r1+r2).

1 Like

I am not a programmer, so I had to look up what the two meant. I found a statement here:

In simple terms, an iterative function is one that loops to repeat some part of the code, and a recursive function is one that calls itself again to repeat the code.

@snibgo shares two cases.
1 Sharpening post interpolation.
2 Sharpening, then repeating it, with or without variation.

Papers seem to indicate that (2) is deleterious to image quality. My impression regarding the repeat of filters is to save time and computing power.

@ajax The article you quoted in your first link says

Radius: determines how wide an area at the transition is affected. 
Try increasing the Radius to 4 and 8, and youā€™ll see that area that is
modified at the transition widens.

Thatā€™s nonsense.
Gaussian blur is a function which calculates a new value for a pixel from the old value of the pixel and the values of surrounding pixels like

newval(x,y) = gauss(oldval(x,y), radius)

The radius determines the size of the surrounding area which will be used to calculate the new value for the pixel. It does not determine the size of the area which will be influenced by the gaussian blur.

You can apply gaussian blur to one pixel out of 10000000 without an effect to the other 9999999 pixels.

Iā€™d say that, as long as the two tools (resize and post-resize sharpening) are active, then theyā€™ll be used in the processing pipeline. However, I havenā€™t tried myself ā€“ I almost always resize my processed images.

@ajax Iā€™m currently working on improving the sharpening tools (USM and RL) in RT.
Maybe worth to follow an issue on github in case you want to sharpen for fine details.
The issue is not only about the Microcontrast tool. Itā€™s also about USM and RL-Sharpening in RT

Thatā€™s what ā€˜RL deconvolutionā€™ in RT does (Richardson-Lucy) :wink:

1 Like

Oh I didnā€™t know that! Consider me educated :smile:

1 Like

I agree, but I will take a look whether a resize from (width1, height1) to (width2, height2) where width1 = width2 and height1 = height2 (which simply keeps the dimensions of the image) is done without effect to the resulting image. If thatā€™s not the case I will change it.

1 Like

Iā€™ve seen a lot of creative license in the use of other disciplinesā€™ terminology in photography - ā€˜recursive sharpeningā€™ would be one.

Recursion is a special form of iteration in algorithms, where the function being performed is called within the function itself. A special form of ā€˜self-eating watermelonā€¦ā€™

I think what you might be reading about would more properly be called ā€˜iterative sharpeningā€™, the theory being one application of size 10 sharpening is less ā€˜niceā€™ to the image than ten successive size 1 applications. Somewhere (maybe here, donā€™t remember) I read about doing downsize resizing as two operations, the first one gets you about 2/3 there, the second one gets you to the target size, and the result is supposed to be as clean as a single operation followed by a sharpen. Same thinkingā€¦

The three applications of sharpening discussed above are about three separate sharpens done in specific places of the workflow for different purposes. I wouldnā€™t think of them as ā€˜iterativeā€™.

If you want to mess with real iterative sharpening, my rawproc tool will let you stack up as many sharpen operations as memory will allow. I only implement USM, but you can easily compare one application of #10 to ten applications of #1ā€¦

Resize to same size currently does nothing. Means, post-resize-sharpening is not called in this case.