You are here

Advanced Unsharp Mask

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

Sharpening tool, uses blurred mask. Sharpness is modified with few sliders that work like a kind of equalizer. User can control blurring parameters (radius and treshold for selective blur mask). It provides 4 types of output: Sharpenned image, mask, split/comparision mode and mask-to-img differences.
Brightness of image can be affected by levels-like tool that works indirectly - via the mask.
See attached screenshot for more info.

Plugin is multithreaded.

Downloads (source code with instructions for linux) and few sample images

Any comments and feature requests welcomed.

GIMP Version: 
Code License: 


1. - Yes, I know, on the beginning I focused on "core" functionality. In regard to apha channel, I understand the plugin should only "ignore" = preserve alpha channel without any change, is it correct? I will add this soon...
2. This is due to algorithm used, I intend to insert "if" there that would simplify algoritm for low radiuses. This would speed up blurring, even though blurring itself takes only about 30 % of plugin work time. But minimum radius for my algorithm is like 3 or 4 px, definitely not less than 1 pixel. Of course, in the future I can add alternate algorithm...
3. sliders - this is what I'm not sure how usefull it is. Each slider controls own distance between brightness of original pixel and mask, currently sliders represents 0.01, 0.03, 0.07, 2 (maximum possible distance is less than 1, because plugin internaly works with RGB values converted to floats in range 0 - 1).
I sometimes use the first slider to reduce noise. If it is usefull to have sliders at all, or I should reduce number of sliders - this is something to discuss.

And thanks for your interest...

Thanks samj; works great with 32-bit GIMP; haven't tested it with 64-bit 2.7.3 yet (but will soon). :)

I just let a comment on your page

A believe nice touch would be allow to apply to only a channel As example only to the L channel (of Lab ) or only to to the Value channel .. that will allow to sharpen without modify hue and saturation

I suppose is already possible run the plugin on a channel,but obviously would require convert the image (i.e to LAB o HSL or HSV) apply on the chosen channel(s) and reconvert back

here i was suggesting to do from the plugin gui adding a dropdown list of channels
(i.e Default "All" or "RGB",...that is as now, then Luminosity, Value,....and so on )

another way to allow something similar but with less complication (but less flexibility ) may be add a option as "Preserve Original Hue & Saturation

if that true
1) the active layer is duplicated
2 )the filter applied to the dup
3 )the 2 layer merged in value mode (= value of edited layer, original Hue and Saturation )

Hint: You can use Wiki Syntax.
Enter a comment:

Thanks for opinion.

From programmer's point of view I dont see any obstacle. Only, I'm not much familiar with theory behind color spaces. I will prepare new wiki page on google code, where I will describe current algorithm and where we can define alternatives you propose. With mathematical formulas of course.

A plugin that often offer to apply the filter only on determinate channel(s) is gmic (as example in most of the filter in Enhancement for sharpening or smoothing)

For this Gmic offers all the possible options, so much that may be confusing:
the most commune and usually the most reasonable for sharpen is apply only on a Luminosity channel to reduce color shift and colour noise.

Manually you may experiment the difference in results
decomposing (as example in LAB or HSL or HSV )
using the filter only on L(ab) or L(hsl) or V(hsv) channel and recombining.

But for the algorithm, it will remain the exactly the same, only the filter may give a option to apply that algorithm to a channel, in one of the color space already available in gimp.

that in the filter code should correspond to call plug-in-decompose, apply the filter as now , just on the chosen channel
, and then call plug-in-recompose .

(i will not know how to code it, just somehow i remembered the names of the function to call )

Im not very familiar with gmic, so I just installed it to see what it is about... looks very complex and powerfull tool...

I just looked at a wiki site about colorspaces – it scaries me. It would take hours and hours to learn it and I'm not interested in theory. And all I need is couple of formulas.

Gimp just doesnt provide API to get lightnes, brightness, luminosity in various colorspaces from RGB image.
There is no call like „give me lumunosity of pixel x,y in HSL colorspace“ nor like “change luminosity of pixel x,z to z“. (Please correct me if I'm wrong)
Gimp provides RGB and needs to get RGB values back, and inbetween you are on your own. Even decompose plugin can provide it – there is no way how to integrate it.
Of course, in theory , you can decompose manualy and then run aumask on particular layer (that represents a channel). But this is complicated for user and a lot of data are lost – because after every transformation data are rounded to be saved as integers 0-255.

So for now I will not work on this. Unless somebody helps me with theory....

one more comment about gmic – sharpening via unsharp mask there looks really good..

Gimp just doesnt provide API to get lightnes, brightness, luminosity in various colorspaces from RGB image.

The libgimp functions for this are described here:

They are defined in the source tree in the following file:

I did not know about this. It looks exactly like what i need for that functionality.
Right now, I'm working on something else, but afterwards I will look at this and will try to incorporate it into my plugin

Never can have too many tools for sharpening and contrast adjustments imo. Any chance you could compile this one for Windows? :)


Subscribe to Comments for "Advanced Unsharp Mask"