I am calling imagecopymerge($dst_r, $logo, 0, 0, 0, 0, $LogoX, $LogoY, 100);
where $logo
is a png file with transparent background. From some reason the background comes out white instead.
What am I doing wrong?
Thanks.
You need to use imagealphablending($dst_r, TRUE);
to allow copying with retaining the transparent colors. Many more comments (...) in the manual suggest using imagecopy
instead, because imagecopymerge was never intended to be used with transparency. If you use pct=100
anyway, then the normal imagecopy might be an option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With