mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
Merge commit '45e6fdb315d113ba13e20a633ed0c67e3f25170d'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Image Functions
|
||||
title: Image Filters
|
||||
description: The images namespace provides a list of filters and other image related functions.
|
||||
date: 2017-02-01
|
||||
categories: [functions]
|
||||
@@ -11,12 +11,9 @@ keywords: [images]
|
||||
toc: true
|
||||
---
|
||||
|
||||
|
||||
## Image Filters
|
||||
|
||||
See [images.Filter](#filter) for how to apply these filters to an image.
|
||||
|
||||
### Overlay
|
||||
## Overlay
|
||||
|
||||
{{< new-in "0.80.0" >}}
|
||||
|
||||
@@ -40,7 +37,7 @@ A shorter version of the above, if you only need to apply the filter once:
|
||||
|
||||
The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
|
||||
|
||||
### Text
|
||||
## Text
|
||||
|
||||
{{< new-in "0.90.0" >}}
|
||||
|
||||
@@ -75,7 +72,7 @@ You can load a custom font if needed. Load the font as a Hugo `Resource` and set
|
||||
```
|
||||
|
||||
|
||||
### Brightness
|
||||
## Brightness
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Brightness PERCENTAGE
|
||||
@@ -93,7 +90,7 @@ images.ColorBalance PERCENTAGERED PERCENTAGEGREEN PERCENTAGEBLUE
|
||||
ColorBalance creates a filter that changes the color balance of an image.
|
||||
The percentage parameters for each color channel (red, green, blue) must be in range (-100, 500).
|
||||
|
||||
### Colorize
|
||||
## Colorize
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Colorize HUE SATURATION PERCENTAGE
|
||||
@@ -104,7 +101,7 @@ The hue parameter is the angle on the color wheel, typically in range (0, 360).
|
||||
The saturation parameter must be in range (0, 100).
|
||||
The percentage parameter specifies the strength of the effect, it must be in range (0, 100).
|
||||
|
||||
### Contrast
|
||||
## Contrast
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Contrast PERCENTAGE
|
||||
@@ -113,7 +110,7 @@ images.Contrast PERCENTAGE
|
||||
Contrast creates a filter that changes the contrast of an image.
|
||||
The percentage parameter must be in range (-100, 100).
|
||||
|
||||
### Gamma
|
||||
## Gamma
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Gamma GAMMA
|
||||
@@ -123,7 +120,7 @@ Gamma creates a filter that performs a gamma correction on an image.
|
||||
The gamma parameter must be positive. Gamma = 1 gives the original image.
|
||||
Gamma less than 1 darkens the image and gamma greater than 1 lightens it.
|
||||
|
||||
### GaussianBlur
|
||||
## GaussianBlur
|
||||
|
||||
{{% funcsig %}}
|
||||
images.GaussianBlur SIGMA
|
||||
@@ -139,7 +136,7 @@ images.Grayscale
|
||||
|
||||
Grayscale creates a filter that produces a grayscale version of an image.
|
||||
|
||||
### Hue
|
||||
## Hue
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Hue SHIFT
|
||||
@@ -148,7 +145,7 @@ images.Hue SHIFT
|
||||
Hue creates a filter that rotates the hue of an image.
|
||||
The hue angle shift is typically in range -180 to 180.
|
||||
|
||||
### Invert
|
||||
## Invert
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Invert
|
||||
@@ -156,7 +153,7 @@ images.Invert
|
||||
|
||||
Invert creates a filter that negates the colors of an image.
|
||||
|
||||
### Pixelate
|
||||
## Pixelate
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Pixelate SIZE
|
||||
@@ -164,7 +161,7 @@ images.Pixelate SIZE
|
||||
|
||||
Pixelate creates a filter that applies a pixelation effect to an image.
|
||||
|
||||
### Saturation
|
||||
## Saturation
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Saturation PERCENTAGE
|
||||
@@ -172,7 +169,7 @@ images.Saturation PERCENTAGE
|
||||
|
||||
Saturation creates a filter that changes the saturation of an image.
|
||||
|
||||
### Sepia
|
||||
## Sepia
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Sepia PERCENTAGE
|
||||
@@ -180,7 +177,7 @@ images.Sepia PERCENTAGE
|
||||
|
||||
Sepia creates a filter that produces a sepia-toned version of an image.
|
||||
|
||||
### Sigmoid
|
||||
## Sigmoid
|
||||
|
||||
{{% funcsig %}}
|
||||
images.Sigmoid MIDPOINT FACTOR
|
||||
@@ -189,7 +186,7 @@ images.Sigmoid MIDPOINT FACTOR
|
||||
Sigmoid creates a filter that changes the contrast of an image using a sigmoidal function and returns the adjusted image.
|
||||
It's a non-linear contrast change useful for photo adjustments as it preserves highlight and shadow detail.
|
||||
|
||||
### UnsharpMask
|
||||
## UnsharpMask
|
||||
|
||||
{{% funcsig %}}
|
||||
images.UnsharpMask SIGMA AMOUNT THRESHOLD
|
||||
|
Reference in New Issue
Block a user