disintegration / imaging

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

Question: Does it support transparency? #124

Closed MALDRU closed 4 years ago

MALDRU commented 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")

I have to do something else or is it not possible to superimpose an image with transparency?

Thanks in advance.

disintegration commented 4 years ago

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

MALDRU commented 4 years ago

Hi.

Thank you very much.