La parte che interessa te è questa:
Codice PHP:
//for png and gif image that maintein the alpha
            
if(($image_type == 1) || ($image_type==3)){
                
imagealphablending($tmpfalse);
                
imagesavealpha($tmp,true);
                
$transparent imagecolorallocatealpha($tmp255255255127);
                
imagefilledrectangle($tmp00$newwidth$newheight$transparent); 
però è strano, quel codice in teoria mantiene la trasparenza, quindi dovrebbe essere come la uppi.