Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rbcbj opened this issue Jul 7, 2023 · 0 comments
Open

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

rbcbj opened this issue Jul 7, 2023 · 0 comments

Comments

@rbcbj
Copy link

rbcbj commented Jul 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant