Skip to content

Commit

Permalink
enhance: image/imageutil: update Overlay() to draw.Over from `d…
Browse files Browse the repository at this point in the history
…raw.Src` to support transparency
  • Loading branch information
grokify committed Jun 15, 2024
1 parent 5146b61 commit 813cc4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions image/imageutil/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 813cc4d

Please sign in to comment.