summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-16 13:52:47 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-17 09:14:18 +0100
commit3ba147e702a5ae0af6e8b3b0296d256c3246a546 (patch)
treebe78ef8f1a2106bf8816f0a8c4f7872169353691 /docs
parenta2d146ec32a26ccca9ffa68d3c840ec5b08cca96 (diff)
images: Add images.Overlay filter
This allows for constructs ala: ``` {{ $overlay := $img.Filter (images.Overlay $logo 50 50 )}} ``` Or: ``` {{ $logoFilter := (images.Overlay $logo 50 50 ) }} {{ $overlay := $img | images.Filter $logoFilter }} ``` Which will overlay the logo in the top left corner (x=50, y=50) of `$img`. Fixes #8057 Fixes #4595 Updates #6731
Diffstat (limited to 'docs')
-rw-r--r--docs/content/en/functions/images/index.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/content/en/functions/images/index.md b/docs/content/en/functions/images/index.md
index e83d41154..e61a10916 100644
--- a/docs/content/en/functions/images/index.md
+++ b/docs/content/en/functions/images/index.md
@@ -17,6 +17,30 @@ toc: true
See [images.Filter](#filter) for how to apply these filters to an image.
+### Overlay
+
+{{< new-in "0.80.0" >}}
+
+{{% funcsig %}}
+images.Overlay SRC X Y
+{{% /funcsig %}}
+
+Overlay creates a filter that overlays the source image at position x y, e.g:
+
+
+```go-html-template
+{{ $logoFilter := (images.Overlay $logo 50 50 ) }}
+{{ $img := $img | images.Filter $logoFilter }}
+```
+
+A shorter version of the above, if you only need to apply the filter once:
+
+```go-html-template
+{{ $img := $img.Filter (images.Overlay $logo 50 50 )}}
+```
+
+The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
+
### Brightness
{{% funcsig %}}