I\'ve been playing around with image processing lately, and I\'d like to know how the unsharp mask algorithm works. I\'m looking at the source code for Gimp and it\'s implement
Unsharp is usually implemented as a convolution kernel which detects edges. The result of this convolution is added back in to the original image to increase edge contrast which adds the illusion of additional "sharpness".
The exact kernel used varies quite a bit from person-to-person and application-to-application. Most of them have this general format:
-1 -1 -1
g = -1 8 -1
-1 -1 -1
Some leave the diagonals out, sometimes you get higher weighs and the whole kernel is scaled, and some just try different weights. They all have the same effect it in the end, it's just a question of playing until you find one that you like the end result of.
Given an input image I, the output is defined as:
out = I + c(I * g), where * is the 2D convolution operator and c is some scaling constant, usually above 0.5 and less than 1 so you avoid blowing out any more channels than you have to.