From 813cc4d2ad7385b848acfdf56377fa01a2234547 Mon Sep 17 00:00:00 2001 From: grokify Date: Fri, 14 Jun 2024 21:38:18 -0700 Subject: [PATCH] enhance: `image/imageutil`: update `Overlay()` to `draw.Over` from `draw.Src` to support transparency --- image/imageutil/overlay.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/image/imageutil/overlay.go b/image/imageutil/overlay.go index 49371766..bc9ef9f6 100644 --- a/image/imageutil/overlay.go +++ b/image/imageutil/overlay.go @@ -8,8 +8,8 @@ import ( func Overlay(src, overlay image.Image, offset image.Point) image.Image { output := image.NewRGBA(src.Bounds()) - draw.Draw(output, src.Bounds(), src, image.Point{}, draw.Src) - draw.Draw(output, overlay.Bounds().Add(offset), overlay, image.Point{}, draw.Src) + draw.Draw(output, src.Bounds(), src, image.Point{}, draw.Over) + draw.Draw(output, overlay.Bounds().Add(offset), overlay, image.Point{}, draw.Over) return output }