What is the difference between convert -unsharp and convert -adaptive-sharpen in ImageMagick

Viewed 1199

I understand that the the convert -unsharp from ImageMagick is using Unsharp Masking to sharpen the image. What kind of algorithm is behind convert -adaptive-sharpen? When I want to sharpen my lanscape images, which algorithm should I use? What are the advantages and disadvantages for the two algorithms?

1 Answers

I'm not an expert on the algorithm, but both operations achieve the same goal by creating a "mask" to scale the intensity of the sharpening. They differ on how the generate the "mask", and the arithmetic operations.

With -unsharp

Given...

original

For demonstration, let's break this down into channels.

channels

Create a "mask" by applying a Gaussian blur.

mask

Apply the gain of the inverse mask if threshold applies.

effect

Ta-Da

result

With -adaptive-sharpen

Given...

original

For demonstration, let's break this down into channels (again).

channels

Create "mask" by applying edge detection, and then Gaussian blur.

mask

Apply sharpen, but scale the intensity against the above mask.

effect

Fin

result

Which command will give the better results for normal outdoor images?

That depends on the subject matter. It's a good rule-of-thumb to use -adaptive-sharpen if the image contains large empty space (sky, sea, grass, &etc), or bokeh/blurred background. Else -unsharp will work just fine.

Related