http://bevrob7.100webspace.net/merge.php
I have this page, as you can see the shadow is black, how can i make this like a real shadow?????
<?php
$off_site = "http://www.mysite.com/travel/BKK/10.jpg";
$fp = fopen ($off_site, 'rb') or die('Unable to open file '.$off_site.' for reading');
$buf = '';
while (!feof ($fp)){
$buf .= fgets($fp, 4096);
}
header('Content-Type: image/jpeg');
$data = $buf;
$src = imagecreatefromstring ($data);
$width = imagesx($src);
$height = imagesy($src);
$aspect_ratio = $height/$width;
if ($height < $width) {
$new_w = 960;
$new_h = 720;
} else {
$new_h = 720;
$new_w = 960;
}
define("DS_OFFSET", 5);
define("DS_STEPS", 10);
define("DS_SPREAD", 1);
$background = array("r" => 255, "g" => 255, "b" => 255);
$nwidth = $new_w + DS_OFFSET;
$nheight = $new_h + DS_OFFSET;
$image = imagecreatetruecolor($width, $height);
$step_offset = array("r" => ($background["r"] / DS_STEPS), "g" => ($background["g"] / DS_STEPS), "b" => ($background["b"] / DS_STEPS));
$current_color = $background;
for ($i = 0; $i <= DS_STEPS; $i++) {
$colors[$i] = imagecolorallocate($image, round($current_color["r"]), round($current_color["g"]), round($current_color["b"]));
$current_color["r"] -= $step_offset["r"];
$current_color["g"] -= $step_offset["g"];
$current_color["b"] -= $step_offset["b"];
}
imagefilledrectangle($image, 0,0, $nwidth, $nheight, $colors[0]);
for ($i = 0; $i < count($colors); $i++) {
imagefilledrectangle
($image, DS_OFFSET, DS_OFFSET, $nwidth, $nheight, $colors[$i]);
$width -= DS_SPREAD;
$height -= DS_SPREAD;
}
$img = imagecreatetruecolor ($new_w,$new_h);
imagecopyresampled ($img,$src,0,0,0,0,$new_w,$new_h,$nwidth,$nheight);
imagecopymerge($image, $img, 0,0, 0,0, $new_w, $new_h, 100);
$image2 = imagerotate($image, $degrees, 0);
imagejpeg($image2, "", 100);
imagedestroy($image2);
?>