HUGO
Menu
GitHub 90529 stars Mastodon

images.Sepia

Returns an image filter that produces a sepia-toned version of an image.
Syntax
images.Sepia STRENGTH
Returns
images.filter

Usage

The images.Sepia function returns an image filter that produces a sepia-toned version of an image.

Arguments

STRENGTH
(float) The strength of the effect, as a percentage in the range [0, 100]. A value of 0 has no effect.

Examples

{{ $filter := images.Sepia 75 }}

Applying the filter with the images.Filter function:

{{ with resources.Get "images/original.jpg" }}
  {{ with . | images.Filter $filter }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
{{ end }}

Applying the filter with the Filter method on a Resource object:

{{ with resources.Get "images/original.jpg" }}
  {{ with .Filter $filter }}
    <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
  {{ end }}
{{ end }}

This is the original image:

Zion National Park

This is the processed image:

Zion National Park