Hallo!
bei GIFs habe ich das so gelöst (allerdings jetzt mit "meinen" Variablennamen, nicht mir Deinen...).
$colorTransparent = imagecolortransparent($image);
$newimage = imagecreate($width, $height);
imagepalettecopy($newimage, $image);
imagefill($newimage, 0, 0, $colorTransparent);
imagecolortransparent($newimage, $colorTransparent);
imagecopyresized($newimage, $image, 0, 0, 0, 0, $width, $height, $xwert, $ywert);
Gruß, Achim