Php uses imagecopymerge to merge two transparent pictures and appear black. How to solve this problem?

scene
the first picture 500X500, the middle area is "copyright" and the rest is transparent;
the second picture is all transparent.

purpose
try to make the word "copyright" transparent.
now use the imagecopymerge function to merge the two images, and the resulting image is black.

Php
Apr.01,2021

$qr_bg_img_info = getimagesize($qr_bg_tpl);
        $w = $qr_bg_img_info[0];
        $h = $qr_bg_img_info[1];
        // set our RGB value from above to be transparent and merge the images with the specified opacity
        $color = imagecolorallocate($dst_img, 255, 0, 0);
        imagearc($dst_img, $w/2, $h/2, $w, $h, 0, 360, $color);
        imagefilltoborder($dst_img, 0, 0, $color, $color);
        imagefilltoborder($dst_img, $w, 0, $color, $color);
        imagefilltoborder($dst_img, 0, $h, $color, $color);
        imagefilltoborder($dst_img, $w, $h, $color, $color);
        imagecolortransparent($dst_img, $color);
        // 
Menu