images.Saturation
Syntax
images.Saturation 百分比
Returns
images.filter
百分比必须在[-100, 500]的范围内,其中0没有任何影响。
用法
创建过滤器:
{{ $filter := images.Saturation 65 }}
使用images.Filter
函数应用过滤器:
{{ with resources.Get "images/original.jpg" }}
{{ with . | images.Filter $filter }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
您还可以使用Resource
对象上的Filter
方法应用过滤器:
{{ with resources.Get "images/original.jpg" }}
{{ with .Filter $filter }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
示例
Original

Processed
