Odd transparency effect when merging two .png with transparency in PHP-GD

Combining two images with transparent sections creates the following composite image:

enter image description here

I wonder why the transparent section of the image that I overlaid on the green background appears as such? Is anyone

$base = imagecreatefrompng('application/assets/images/vel1_bg.png'); imagealphablending($base, false); imagesavealpha($base, true); list($baseWidth, $baseHeight, $type, $attr) = getimagesize('application/assets/images/vel1_bg.png'); $user_board_items = $this->config->item('user_board_items'); foreach($array as $key => $value){ $item = imagecreatefrompng('application/assets/images/items/' . $user_board_items[$value[0]] . '.png'); imagealphablending($item, false); imagesavealpha($item, true); list($width, $height, $type, $attr) = getimagesize('application/assets/images/items/'. $user_board_items[$value[0]] . '.png'); imagecopyresampled($base, $item, floor(($value[1] / 100) * $baseWidth), floor(($value[2] / 100) * $baseHeight), 0, 0, $width, $height, $width, $height); imagedestroy($item); } //We have to capture the output buffer ob_start(); imagepng($base); $baseimg = ob_get_clean(); 
0
source share
1 answer

GD does not support transparency in 32-bit PNG. You should use either 8-bit with one transparent โ€œcolorโ€ or 24-bit (officially 24-bit does not support transparency, but Photoshop can do this when using โ€œsave for webโ€ with 24-bit png).

+1
source

Source: https://habr.com/ru/post/956411/