images.ColorBalance
Syntax
images.ColorBalance 红色百分比 绿色百分比 蓝色百分比
Returns
images.filter
红、绿、蓝三个通道的百分比必须在[-100, 500]范围内。
用法
创建滤镜:
{{ $filter := images.ColorBalance -10 10 50 }}
使用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
