disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.3k stars 443 forks source link

Rotated image background won't blend according to Alpha when pasting #164

Open rbcbj opened 1 year ago

rbcbj commented 1 year ago

Description

I am trying to rotate an image and pasting it over other one. I wanted that the background of the area under rotated image to be "transparent" and have used color.Alpha{0}.

Though, when pasting:

image45 := imaging.Rotate(watermark, float64(-45), color.Alpha{0})
image = imaging.Paste(image, image45, image.Pt(0, 0))

The background won't respect the alpha and won't blend, instead, it will be black.

After some tries, I've used the image.Draw and it will definitely make it work:

draw.Draw(image, image.Bounds(), image45, image.Point{}, draw.Over)

Shouldn't the imaging.Paste result in the same output?

Thanks