PHP imagecopy avec un fond transparent

J'utilise ce code pour créer une image à partir d'une autre image png, le fond est noir par défaut. Ma question est comment mettre un fond transparent?

$input = imagecreatefrompng('image.png');
$output = imagecreatetruecolor(50, 50);

imagecopy($output, $input, 4,0, 8,8, 8,8);
imagecopy... etc.

header('Content-Type: image/png');
imagepng($output);

Est-il un moyen facile de faire cela? Grâce

OriginalL'auteur 2by | 2011-10-11