| 1 |
--- |
| 2 |
title: images.UnsharpMask |
| 3 |
description: Returns an image filter that sharpens an image. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
aliases: [] |
| 9 |
returnType: images.filter |
| 10 |
signatures: [images.UnsharpMask SIGMA AMOUNT THRESHOLD] |
| 11 |
--- |
| 12 |
|
| 13 |
The sigma argument is used in a gaussian function and affects the radius of effect. Sigma must be positive. The sharpen radius is approximately 3 times the sigma value. |
| 14 |
|
| 15 |
The amount argument controls how much darker and how much lighter the edge borders become. Typically between 0.5 and 1.5. |
| 16 |
|
| 17 |
The threshold argument controls the minimum brightness change that will be sharpened. Typically between 0 and 0.05. |
| 18 |
|
| 19 |
## Usage |
| 20 |
|
| 21 |
Create the filter: |
| 22 |
|
| 23 |
```go-html-template |
| 24 |
{{ $filter := images.UnsharpMask 10 0.4 0.03 }} |
| 25 |
``` |
| 26 |
|
| 27 |
{{% include "/_common/functions/images/apply-image-filter.md" %}} |
| 28 |
|
| 29 |
## Example |
| 30 |
|
| 31 |
{{< img |
| 32 |
src="images/examples/zion-national-park.jpg" |
| 33 |
alt="Zion National Park" |
| 34 |
filter="UnsharpMask" |
| 35 |
filterArgs="10,0.4,0.03" |
| 36 |
example=true |
| 37 |
>}} |