The secret of the Unsharp Mask…

… well, putting that title in Google gives me more than 90,000 hits, so it mustn’t be that secret. However, a wise use of the USM (Unsharp Mask’s nickname) can really help making most of your pictures.

The principle

Obviously, no amount of digital trickery will be able to bring a blurred photo back to sharpness. The principle at work with USM is to locally enhance edge contrast which makes an image look sharper.

So, say we have a dark gray edged with light gray area. The USM will enforce the dark area close to the limit and lighten the light one (if you sill follow), thus giving a contrast push and enhance the impression of sharpness. This is an over-the-top example to show the principle:

usm.jpg

In the dark ages…

Or more precisely in the darkroom age, USM was achieved by getting a blurred positive (out of focus exposing of the negative on film slide) and combining it with the original negative for printing.

Because of this “blur” component, USM is called Unsharp even though its final goal is to make the image look sharper.

In the digital age…

Nowadays, the principle remains, but it is achieved digitally. So when you open your USM dialog in your favorite photo application, you get 3 parameters to play with:

  • amount: how much of the unsharped image will be used in the final version.
  • radius: what the radius of the blur should be.
  • treshold: at what level an edge is considered an edge (and worth unsharping). This is mainly used to avoid sharpening noise in high iso images (and degrading the image quality with USM), but you could also use it to avoid sharpening skin defaults for example.

How to use it

It is not possible to define general work-everywhere settings, so get ready to experiment. Remember to look at your image at 100% zoom level when applying USM otherwise you won’t be able to really judge its effect.

Once applied (and image saved), the USM cannot be undone. Adding blur will not remove its effect. So generally speaking, a high quality image like the ones we are learning to produce should not be saved / archived with USM applied.

Actually (and just because things are always a bit more complicated), there are two different usages you with with USM: local contrast enhancement and micro details boost. The first one can be applied on your high quality image (like we did before), while the second one depends on the ouput format (web, print) so you don’t want to apply it on the high-quality image you archive.

Local Contrast Enhancement

In this case, you boost the general contrast of an image. You use a large radius (something like 30) and little value (from 0.10 to 0.50). The effect is quite radical and image saturation may need to be toned down a bit afterwards (10-20 points).

Another over-the-top example – but you can see that the contrast boost… The values used were radius:30, value:0.70 and treshold:0.

usm1.jpg

If you over-do this step (apart from bad taste), you will start seeing light halos in dark areas. The undo button is your friend in this case.

Micro Detail Enhancement

This is the part you don’t want to add to your high quality file. Typically, when you scale down an image for screen view, you start with your 2000 x 3000 (or more) pixel image to shrink it to 800×600 (or less). The result is a bit blurry and image lacks “pop” – which we can “retrieve” with USM. So this Micro Detail Enhancement USM part depends on what image you start with and the final destination of your image – we will discuss the screen version here, the print version will come later.

So after resizing you want to apply an USM with small radius value (0.1-1), amount has to be decided case by case (between 0.2 and 1 .0, maybe more) and treshold depending on the image too.

Be careful not to overdo it. In this case the image “hurts the eyes” – it is hard to describe but you see it when it happens. The problem is that the older the screen the more blurry the image: so what looks good on your old screen will scream “too much” on a more recent one. So in a much as the effects nicely boosts the image, better have a little less than a little too much.

So here is again my favorite autumn view strait after resize:

aubonne_nat.jpg

The same with an USM of 1.0 / 0.50 / 0 – what I consider a good version:

aubonne_usm.jpg

Finally with an USM of 1.0 / 1.0 / 0 – too much:

aubonne_toomuch.jpg

Final word: good taste and undo

Like with so many things, trial and error is the best way to learn – undo is your friend. Don’t hesitate to save several copies (or make several layers) with different USM settings and compare. Don’t hesitate to leave the picture unattended for 2 days and get back to it for a fresh look. Practice, practice and practice…

10 Responses to The secret of the Unsharp Mask…

  1. colinut says:

    As an alternative I use the highpass filter.

    1. Duplicate original layer
    2. Apply a high-pass filter on the copy layer (amount dependson image rez)
    3. Change blending mode of the copy to softlight.
    🙂

  2. jcornuz says:

    Hi there,

    good to read from you again. It looks like there is a high-pass filter available as an external plug-in for Gimp. I haven’t found one in Cinepaint, though…

    Does your method gives better result than USM?

    Take care,

    Joel

  3. neri says:

    There is/was a plugin called refocus. http://refocus.sourceforge.net/
    However, it was abandoned and does not really build on newer systems with the gimp anymore. I try to maintain a legacy version for Archlinux in their repositories, but sooner or later it will die, which is very unfortunate since it gives the best sharpening results I have ever seen. Refocus uses a Fir/Wiener algorithm that can do any sharpening from gentle to destroying with really amazing results. I wish I had the skills and the time to port that to gimps new plugin previews …

  4. jcornuz says:

    Hi Neri,

    Thanks for the info. The good thing about OSS is that anyone (with the right skills) can pick the project up… Let’s hope the right person comes across it…

    Take care,

    Joel

  5. neri says:

    Okay, I might have been a bit fast here, there is a version for Ubuntu available fro this reository: http://packages.ubuntu.com/gutsy/graphics/gimp-refocus

    I dunno if this version is still uptodate for the latest ubuntu version. Anyway, if you have a chance to evaluate it, I would like to hear if it is useful. I mean, I like the result, but then I’m the kind of guy who can be impressed with a slightly higher saturation setting, too …

    Also, I looked into the code and it seems porting it to gimps newer native preview stuff seems fairly straight forward. So I might take wrench to the engine, ahem some code lines to the editor.

  6. Thanks for the hint to gimp-refocus. The refocus algorithm is implemented in digikam, and I always use it for standard sharpening in digikam.
    gimp-refocus still works but needs some tweaking for the preview because the current version does not show the preview-move icon. Unfortunately my programming skills are not up to this task…

  7. neri says:

    Markus,

    my guess is that the way refocus implements the preview was the original design that eventually worked it’s way upstream into the gimp code base. In refocus you can move the preview just by grabbing (click and drag) within the preview area, like moving images when holding space down.

    But yes, eventually it should be ported to the gimps internal preview stuff.

  8. jcornuz says:

    Hi there !

    Interesting discussion here. I had a look at the plug-in: it works like a charm on Ubuntu. As far as I can see, it is an (enhanced) unsharp mask. Documentation can be found here: refocus.sourceforge.net/doc.html.

    As far as my first trials show, it looks like the results are a bit better than the standard unsharp mask (less halo prone). However, it doesn’t look to work with a big radius to do local contrast enhancement.

    An interesting tool – thanks for your efforts to keep in in shape.

    Take care,

    Joel

  9. Yes, my tests too show that refocus is good for standard sharpening with a small radius. In digikam (which works with 16bit values) I got used to two passes of sharpening treatments: USM with radius 60, strength 0.2, treshold 0 and afterwards refocusing with the defaults. I have experienced only a small number of pictures that do not benefit from this approach.

    Regards – Markus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: