Sharpening images with GIMP
Preamble: various sharpening methods
Gimp employs a number of methods for sharpening an image, whether this is an attempt to increase its actual sharpness or its perceived sharpness. Somewhat counterintuitively, the latter method is better since the former has a rather annoying tendency to introduce noise into the image.
Probably one of the best known of the "perceived" sharpening methods is the curiously named unsharp mask. It's left as an exercise for the reader to find out the thinking behind the name, partly as any explanation here will be misleading and only entertaining for its confused writing style, but it's perhaps worth mentioning that its use predates digital photography. By quite some time. But its digital analogue, quickly skimming over the unintentional pun, employs much the same technique.
However, as much of an improvement as the unsharp mask is, it still leaves much to be desired: its various parameters can be the source of frustrating and often fruitless fiddling and it can give some annoying results, such as the unwanted accentuation of noise and the appearance halos around certain objects in the image.
Fortunately, Jeff's high-pass filter comes to the rescue. Or at least my interpretation of it, since some of the functionality needed to implement it seemed to be missing in Gimp.
Sharpening with the high-pass filter
Click on an image for a larger picture
Once the selected file has been opened, Gimp's main dialogue (fig. 1) will materialise. This contains three main sections: the toolbox, the layers menu and the image itself. For the purpose of this technique we shall largely concentrate on the layers menu (fig. 2)
A very quick overview of this method (described in detail below) is as follows: create two duplicates of the base layer. Blur the top layer, then invert its colours; do a 50% overlay and merge down with the second non-blurred, non-inverted image to create a mask; and finally, apply this mask to the original bottom layer with its mode set to hard-light and do a final merge-down to leave the final, sharpened layer. If this sounds like complete gibberish, read on—and be confused in more detail!
Part one: duplicating the base layer
The first step is to create duplicates of the layer containing our image. We need two duplicates so that we have a total of three identical copies. The easiest way to do this is to use the "duplicate layer" button in the layers dialogue (fig. 2): this is the one near the bottom showing the two overlapping screens. Click on it twice.
Part two: blurring the top layer
Next, we need to blur the top layer. Select it in the layers menu by clicking on it so that it is highlighted, as shown in figure 2. Now, in the main image window, select gaussian blur: this is in the "blur" section of the Filters dialogue in the window's main toolbar (fig. 3).
This will present the dialogue shown in figure 4: choose an appropriate blur radius for the image using the preview box as a guide: I find that around 7 works well for large images of around 4000 × 3000, whereas much smaller figures down to 1½ or less may be more suitable for images only a couple of hundred pixels across; but experiment away until you find settings that you feel happy with.
Part three: colour inversion
The mask is created by first inverting the colours on the top, blurred layer. This is a straightforward task that simply involves clicking on the "invert" tool on the colours drop-down on the image window's main toolbar (fig. 5), making sure that the top layer is still selected in the layers menu (fig. 2). A word of caution: wait until the blurring stage has completed before doing this otherwise the two procedures may overlap! You should now have something that looks like figure 6.
Part four: creating a mask
The "sharpening mask" is created first by overlaying our new blurred, inverted image with the "normal" second layer. This is accomplished by setting the top layer's opacity to 50%: in the layers dialogue, ensure that the layer mode is set to "normal" (this is the default) and change its opacity from 100% to 50% by either using the slider or, if you prefer to do it the easy way, by typing "50" into the "opacity" box (fig. 7). This should result in a greyish-looking image as shown in our example in figure 8. Note that it isn't completely grey! If you look closely, you can just about make out a "ghost" of the original image. If done correctly, these outlines should be fairly visible but not too obvious.
Next, merge the top two layers into one so that we can apply it to the base layer. Once again in the layers menu, right-click on the top layer and select "merge down" (fig. 9).
Part five (optional): tweaking our mask
As noted in part four, the outline on the "grey" image should be visible but not too heavy. If for whatever reason it turns out that it is a little too severe for the final result, then this may be altered by using the "levels" dialogue in the colours section of the image's main toolbar (fig. 10).
The levels may be adjusted as follows: the mask's contrast may be reduced by narrowing the output levels to compress the grey tones into a smaller part of the overall range, thus reducing the difference between them. Since that's a terrible explanation, in practical terms we need to choose a number, typically between 30 and 50, and put it in box A shown in figure 11; the larger the number, the vaguer our mask gets. This will change the brightness of the grey image to something other than its neutral grey, which we really don't want, so to counteract this we need to put another number into box B; this number is calculated by subtracting whatever we entered in box A from 255: this isn't a random value, 255 is the maximum level allowed (the maximum decimal value that can be stored as an unsigned 8-digit binary number, if you absolutely must know. Computers are awfully fond of these eight digit numbers; blame IBM, who also coined the ridiculous name "byte" when "word" was previously good enough for everybody else). So if we choose 30 for box A, enter 225 in box B: 255 − 30 = 225, see?
Once you're happy with the results, proceed to the next step!
Part six: nearly there!
Now that we have our sharpening mask, all that's left is to apply it to our base image. Back to the layers menu, with the top layer selected—our mask—click the "mode" drop-down menu and change its setting from "normal" to "hard light". This should be all that is required, but if you feel that the end result is a bit too much, alter the opacity setting using the slider until you have the effect you want.
Finally, merge the two layers using the "merge down" function shown in figure 9, and you're all done! You should now have something along the lines of figure 13, although the differences should be much more noticeable at full size; this image has been reduced to half size, so the results are not as obvious: the point is, they should be subtle rather than really in-your-face!
A big "well done" if you managed to work your way through all that rambling.
