'imagecopy()'和'imagecopymerge()'之间的区别?

And*_*iga 6 php gd

PHP GD库中这两个函数有什么区别?

bip*_*pen 14

这两个函数非常相似,因为它们将一张图片复制到另一张图片中.

这些函数的不同之处在于最后一个参数:imagecopy()始终使用源的像素覆盖目标中的所有像素,而imagecopymerge()将目标像素与源像素合并为额外参数中指定的量:

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". 
Run Code Online (Sandbox Code Playgroud)

imagecopy()因此,该函数等同于调用imagecopymerge()并传入100作为最后一个参数.