OK, mostly done, but my image transparency doesn't seem to be working... any ideas?
<?
echo "<html>\n<head><title>making imgs</title></head>\n\n<body>";
function imagedropshadow($rscimg, $outimg, $shr, $shg, $shb, $shadowwidth){
//create the two images from the boxes
$pngbox1=imagecreatefrompng($rscimg);
$pngbox2=imagecreatefrompng($rscimg);
//get the width & height of resource image, add one (to allow space for shadow
$outwidth=imagesx($pngbox1)+$shadowwidth;
$outheight=imagesy($pngbox1)+$shadowwidth;
$inwidth=imagesx($pngbox1);
$inheight=imagesy($pngbox1);
$startcolor=imagecolorat($pngbox1,ceil($inwidth/2),0);
//create the box image
$box=imagecreate($outwidth,$outheight);
//set colors in pngbox2, then replace line with grey line
$shadow=imagecolorresolve($pngbox2,$shr,$shg,$shb);
imagefill($pngbox2,15,0,$shadow);
//set white as transparent on the box being placed on top
$white=imagecolorresolve($pngbox1,255,0,0);
$white2=imagecolorresolve($pngbox2,255,0,0);
imagecolortransparent($pngbox1,$white);
imagecolortransparent($pngbox2,$white2);
//copy the images, bottom left then top right
for ($k=$shadowwidth; $k>0; $k=$k-1){
imagecopy($box, $pngbox2, $k, $k, 0, 0, $inwidth, $inheight);
}
imagecopy($box, $pngbox1, 0, 0, 0, 0, $inwidth, $inheight);
imagepng($box,$outimg);
echo "<img src='$outimg'>";
}
$rscimg="test/button.png";
$outimg="test/output.png";
imagedropshadow($rscimg, $outimg, 192, 192, 192,1);
echo "</body></html>";
?>