What is the difference between these 2 functions from the PHP GD library?
These two functions are both quite similar in that they copy one picture into another.
The way these functions differ is in the last parameter: imagecopy()
always overwrites all the pixels in the destination with those of the source, whereas imagecopymerge()
merges the destination pixels with the source pixels by the amount specified in the extra parameter:
0 means "keep the source picture fully",
100 means "overwrite with the source picture fully",
and 50 means "mix the source and destination pixel colours equally".
The imagecopy()
function is therefore equivalent to calling imagecopymerge()
and passing in 100 as the last parameter.
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