Code:
//obere Abdunkelung
ImageAlphaBlending($bg, true);
$plotD = 80;
imagefilledrectangle ($bg, 0, 0, 800, $plotD-1, ImageColorResolveAlpha ($bg, 0, 0, 0, ($plotD/2)));
while($plotD < 254)
{
// Draw a line and move it down and make it lighter to get the gradient effect
ImageLine($bg, 0, $plotD , 800, $plotD, ImageColorResolveAlpha($bg, 0, 0, 0, ($plotD/2)));
$plotD++;
}
if ($bg) {
imagecopyresampled($im, $bg, 0, 0, 0, 0, $image_width, $image_height, imagesx($bg), imagesy($bg));
}
//linke Abdunkelung
$plotD = 80;
imagefilledrectangle ( $bg ,0 ,0 ,$plotD-1 ,600 ,ImageColorResolveAlpha ($bg, 0, 0, 0, ($plotD/2)));
while($plotD < 254)
{
// Draw a line and move it down and make it lighter to get the gradient effect
ImageLine($bg, $plotD, 0 , $plotD, 600, ImageColorResolveAlpha($bg, 0, 0, 0, $plotD/2));
$plotD++;
}
if ($bg) {
imagecopyresampled($im, $bg, 0, 0, 0, 0, $image_width, $image_height, imagesx($bg), imagesy($bg));
}
//rechte Abdunkelung
$plotD = 850;
while($plotD > 596)
{
// Draw a line and move it down and make it lighter to get the gradient effect
ImageLine($bg, $plotD, 0 , $plotD, 600, ImageColorResolveAlpha($bg, 0, 0, 0, 127-(($plotD-850)/2)));
$plotD--;
}
if ($bg) {
imagecopyresampled($im, $bg, 0, 0, 0, 0, $image_width, $image_height, imagesx($bg), imagesy($bg));
}