images.Grayscale
Syntax
images.Grayscale
Returns
images.filter
用法
创建过滤器:
{{ $filter := images.Grayscale }}
使用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
