Add a set of image filters

With this you can do variants of this:

```
{{ $img := resources.Get "images/misc/3-jenny.jpg" }}
{{ $img := $img.Resize "300x" }}
{{ $g1 := $img.Filter images.Grayscale }}
{{ $g2 := $img | images.Filter (images.Saturate 30) (images.GaussianBlur 3) }}
```

Fixes #6255
This commit is contained in:
Bjørn Erik Pedersen
2019-08-26 19:12:41 +02:00
parent f9978ed164
commit 823f53c861
89 changed files with 791 additions and 139 deletions

View File

@@ -14,6 +14,7 @@
package resource
import (
"github.com/disintegration/gift"
"github.com/gohugoio/hugo/langs"
"github.com/gohugoio/hugo/media"
@@ -47,6 +48,7 @@ type ImageOps interface {
Fill(spec string) (Image, error)
Fit(spec string) (Image, error)
Resize(spec string) (Image, error)
Filter(filters ...gift.Filter) (Image, error)
}
type ResourceTypesProvider interface {