images.Pixelate
语法
images.Pixelate SIZE
返回值
images.filter
用法
创建过滤器
{{ $filter := images.Pixelate 4 }}
使用 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 }}
示例
原始图像

已处理图像
