I got an issue when i try to resize a PNG image, it always add me a black backgroud to the image instead of being white.
here is a sample of my code (PHP)
<?php
$url='https://vignette.wikia.nocookie.net/mario/images/d/d7/SMO_Art_-_Mario.png/revision/latest/scale-to-width-down/430?cb=20170129083448&path-prefix=fr';
$image_encode = base64_encode(file_get_contents($url));
$image_decode = base64_decode ( $image_encode );
$formImage = imagecreatefromstring ( $image_decode );
// imagepng($formImage,'simpletext.png'); //save image into file
 list($width_orig,$height_orig) = getimagesizefromstring ( $image_decode );
 $sizeX4 = $width_orig/4;
 $new_height = $height_orig/4;
 $resizeimage = imagecreatetruecolor ( $sizeX4, $new_height );
 imagealphablending($resizeimage, FALSE);
 imagesavealpha($resizeimage, TRUE);
 imagecopyresampled ( $resizeimage, $formImage, 0, 0, 0, 0, $sizeX4, $new_height, $width_orig, $height_orig );
 header('Content-Type: image/png');
 imagepng($resizeimage,'mario.png');
 imagedestroy($resizeimage);
 imagedestroy($formImage);
?>
 
    