Open rbcbj opened 1 year ago
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}.
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:
image.Draw
draw.Draw(image, image.Bounds(), image45, image.Point{}, draw.Over)
Shouldn't the imaging.Paste result in the same output?
imaging.Paste
Thanks
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:
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:Shouldn't the
imaging.Paste
result in the same output?Thanks