Skip to content

Commit

Permalink
Use image.NewNRGBA as default (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshineplan authored Sep 12, 2024
1 parent ba915b2 commit 877567e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion format.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func (f *FormatOption) Encode(w io.Writer, img image.Image) error {
}

if cfg.background != nil {
i := image.NewRGBA(img.Bounds())
i := image.NewNRGBA(img.Bounds())
draw.Draw(i, i.Bounds(), &image.Uniform{cfg.background}, img.Bounds().Min, draw.Src)
draw.Draw(i, i.Bounds(), img, img.Bounds().Min, draw.Over)
img = i
Expand Down
2 changes: 1 addition & 1 deletion watermark.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (w *WatermarkOption) SetOffset(offset image.Point) *WatermarkOption {
}

func (w *WatermarkOption) do(base image.Image) image.Image {
img := image.NewRGBA(base.Bounds())
img := image.NewNRGBA(base.Bounds())
draw.Draw(img, img.Bounds(), base, image.Point{}, draw.Src)
var offset image.Point
var mark image.Image
Expand Down

0 comments on commit 877567e

Please sign in to comment.