Unsharp masking is a technique to sharpen images, where a blurred version of an image is subtracted from the image itself. The typical blending formula used for unsharp masking is as follows: sharpened = original + (original − blurred) × amount.
Here, amount is a parameter. The next few sections demonstrate how to implement this with the ndimage module of SciPy functions in Python.