images.ColorBalance
每個通道(紅色、綠色、藍色)的百分比必須在範圍 [-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
