Просмотр поста #65137: >>>ВОПРОСЫ НОВИЧКОВ<<<

.
L!MP
//...твой код
$img2 = imagecreatetruecolor($x, $y);

//это то что нужно добавить
imageAlphaBlending($img2, FALSE);
imageFill($img2, 0, 0, imageColorAllocateAlpha($img2, 255, 255, 255, 0));
imageSaveAlpha($img2, TRUE);

// продолжение твоего кода...
imagecopyresampled($img2, $img, 0, 0, 0, 0, $x, $y, $xy[0], $xy[1]);