Попробуйте установить прозрачный цвет с помощью imagecolortransparent:
http://il.php.net/manual/en/function.imagecolortransparent.php