Creating a transparent image filled with tranparent color only
I had some hard times putting up this one:
<?php
// Set the image
$img = imagecreatetruecolor(100,100);
imagesavealpha($img, true);
// Fill the image with transparent color
$color = imagecolorallocatealpha($img,0x00,0x00,0x00,127);
imagefill($img, 0, 0, $color);
// Save the image to file.png
imagepng($img, "file.png");
// Destroy image
imagedestroy($img);
?>