<?php
header ("Content-type: image/png");
$im = imagecreatetruecolor(320, 240);
$ink = imagecolorallocate($im, 255, 255, 255);
$col = imagecolorallocatealpha($im, 255, 255, 255, 96);
// Функция рисующая "правильный" прямоугольник
function imagetransparentrectanle($im,$x1,$y1,$x2,$y2,$col) {
imageline($im, $x1, $y1, $x2, $y1, $col );
imageline($im, $x1, $y2, $x2, $y2, $col );
imageline($im, $x1, $y1+1, $x1, $y2-1, $col );
imageline($im, $x2, $y1+1, $x2, $y2-1, $col );
}
// "Правильный" прямоугольник
imagetransparentrectanle($im,10,10,100,100,$col);
// Стандартный прямоугольник
imagerectangle($im,110,110,200,200,$col);
imagepng($im);
imagedestroy($im);
?>