Closed MALDRU closed 4 years ago
Hi.
I am using the "Paste" method to overlay an image (watermark) .png which has transparency but when looking at the result it is superimposed without its transparency.
dst := imaging.Paste(dst, watermark, image.Pt(xPos, yPos)) err = imaging.Save(dst, "img.png")
dst := imaging.Paste(dst, watermark, image.Pt(xPos, yPos))
err = imaging.Save(dst, "img.png")
I have to do something else or is it not possible to superimpose an image with transparency?
Thanks in advance.
Hi,
There is a similar function called Overlay that takes the alpha channel into account when combining two images. https://pkg.go.dev/github.com/disintegration/imaging?tab=doc#Overlay
Overlay
Thank you very much.
Hi.
I am using the "Paste" method to overlay an image (watermark) .png which has transparency but when looking at the result it is superimposed without its transparency.
dst := imaging.Paste(dst, watermark, image.Pt(xPos, yPos))
err = imaging.Save(dst, "img.png")
I have to do something else or is it not possible to superimpose an image with transparency?
Thanks in advance.