43

I'm interested in getting into post-processing stuff, and I'm wondering about the Unsharp Mask operation. Specifically, there are 3 parameters involved:

  • amount
  • radius
  • threshold

What do these do? Should I just leave them on the default settings? If not, what are the criteria for modifying them in each direction?

46

Some background:
The unsharp mask is an old technique that has been used in darkrooms long before computers were capable of processing images.

The original process consists of two exposures; first you create an unsharp mask by making a contact copy on low-contrast positive film, but with a distance between the original and film (and sometimes a diffusing plastic sheet) so that it becomes blurred. When you put the blurred positive and the negative together and make an exposure on paper, the positive cancels out some of the light from the negative. As the positive is blurred, it lets through more of the small details, which makes the image appear sharper.

Two of the parameters directly correspond to this old method;

  • The radius is how much the positive is blurred.
  • The amount is how much the positive is exposed.

The threshold has been added to enable you to exclude low-contrast edges from the sharpening.

A good baseline for the radius is around 0.1 mm. For an image that is to be viewed on a screen, which is about 100 ppi, it translates to a radius of 0.4. For an image that is to be printed at 300 ppi, it translates to a radius of 1.2.

When I sharpen images in the final step for publishing on my web site, I use these settings after rounding:

  • Amount: 50%
  • Radius: 0.5
  • Threshold: 2
  • 5
    +1 Excellent answer! The background information was informative. – jrista Jul 25 '10 at 2:53
  • And this explains why in Lightroom the standard setting is 1.0: intermediate first-approximation value between screen and paper. – FarO Nov 10 '15 at 14:28
  • @Guffa if I translate 0.1 mm into pixels (=ppi/254), I get 0.4 at 100 ppi and 1.2 at 300 ppi. Are your values approximations? they don't match your reasoning. – FarO Oct 6 '16 at 16:04
  • @OlafM: Yes, there is a bit of rounding there. If you publish images on the web you don't know the exact resolution of the screen, only that it will be somewhere around 100 ppi. – Guffa Oct 7 '16 at 23:46
  • @Guffa I think you should correct the post with exact values and calculation (or I'll do it myself if the formula I wrote is correct) and only then add the rounding and related reasoning: I found your post in relation to printing, where I know exactly the resolution! – FarO Oct 9 '16 at 8:21
15

The unsharp mask will increase the perceived sharpness of an image by increasing the contrast of pixels next to each other. It does so by making darker pixels a bit darker, and brighter pixels a bit brighter.

  • The amount parameter will control how much darker or brighter the pixels will be made.
  • The threshold parameter will prevent the filter from having any effect unless the difference between pixels is large enough.
  • The radius parameter determines how large area around each pixel that will be analyzed when performing the calculations.

Different images will require different settings. I typically use (in Photoshop) radius as low as possible, amount at around 80%, and then experiment with the threshold so that the sharpening happens where it is intended.

If the amount is too high, the image will look "over sharpened" in an unnatural way. If radius is too high, there will be a halo effects in sharpened areas of the image and if the threshold is too low, it may make image noise become more apparent. If radius or amount is too low or if threshold is too high, the result will be that there is no or little effect of the operation.

  • Good, an answer that answers the question! – labnut Mar 26 '11 at 7:15
  • 1
    +1, but reading this again, I think that the radius parameter does not correspond to the analysis phase (that is what the threshold is for) but for the effect application phase. – ysap Jul 15 '11 at 15:35
  • +1 Thanks a lot! I think this answer is more practical in terms of what each settings mean and how changing each will it impact my image. – Tejas Oct 9 '11 at 9:52
4

Bojidar Dimitrov has a great article about unsharp mask here. The article has example images and it also visualizes the parameters.

  • 3
    Can you summarize? – mattdm Mar 26 '11 at 2:43
1

Let's illustrate what Unsharp Mask is doing:

  1. Take image, let's call it I.
  2. Create a blurred version of it using Gaussian Blur with radius r. Let's call it B.
  3. Let's create High Pass image H by H = I - B.
  4. Let's create the Unsharp Image U by U = I + a * H.

Now, the Radius r used in Gaussian Blur is exactly the radius in the Unsharp Mask.
The Amount parameter is a as in the calculation of the Unsharp Mask image U.

Threshold t is the tricky one.
It actually says the following per each pixel:

If the absolute value of B is greater than t (The threshold) then take the value of U else leave as I.

Davide Barranca has an amazing and hilarious video on his product DoubleUSM.
Just follow the few first minutes as he explains Unsharp Mask better than anyone else with visualizations.

Corey's Request

In order to replicate Unsharp Mask using Layers:

To make it briefly, Assuming O is the original this is the way to recreate Unsharp Mask (The first word is the layer name, just create those names):

  1. 'GB' - Create a duplicate of O, apply Gaussian Blur.
  2. 'O-GB' - Duplicate the layer 'O'. Using 'Apply Image' subtract the layer 'GB'.
  3. 'inv(GB)' - Duplicate 'GB' layer and invert it.
  4. 'O+inv(GB)' - Duplicate 'O' layer and using 'Apply Image' add the 'inv(GB)' layer.
  5. 'inv(O+inv(GB))' - Duplicate 'O+inv(GB)' and invert it.

It doesn't include the Threshold (Namely it is exactly for Threshold 0).
To include it one whould need to create mask based on Absolute value of O - GB which isn't pretty in Photoshop.

  • I would love to see this further explained in using layer properties (eg High Pass image H is created by layering B over I using layer blending mode "subtract" on layer B) to further exemplify how the USM can be created with very precise control over every step. – Hueco Feb 23 '18 at 22:19
  • @Corey, I updated it according to your request. Though, really, see the movie, it explains Unsharp Mask perfectly. – Royi Feb 23 '18 at 22:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.