I am trying to create an image from another image using PHP. Here is my code:
<?php $width = 109; $height = 109; $image = imagecreatetruecolor($width, $height); $source_under = imagecreatefrompng('ecloid_under.png'); $black = imagecolorallocate($image, 0x00, 0x00, 0x00); imagecolortransparent($image, $black); imagecopy($image, $source_under, 0, 0, 0, 0, $width, $height); header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?>
So, I upload this image to $source_under

and copy it to the transparent blank canvas image. Here is the result of this operation:

As you can see, around the entire source image there is a kind of black frame. I think this is due to the fact that initially the image "canvas" is all black. Thus, something is wrong with the transparency and smoothing of the image.
This is not the first time I have a similar problem, but the last time the reason was the original image. This time, opening it in Photoshop, it does not show any potential problems.
Does anyone know how to fix this?
source share