<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(400, 200);


    $trans_colour = imagecolorallocate($im, rand(50, 200), rand(50, 200), rand(50, 200) ); // 200);
    imagefill($im, 1, 1, $trans_colour);

$text_color = imagecolorallocate($im, 255, 255, 255);

//imagestring($im, 7, 5, 5,  date('c'), $text_color);

//echo __DIR__ . '/arial.ttf';
//exit();

// Add the text
$text = date('H:i:s');

$x = 60; $y= 125;
imagettftext($im, 54, 0, $x, $y, $text_color, __DIR__ . '/arial.ttf', $text);


header('Content-Type: image/jpeg');
header("Last-Modified: ".gmdate("D, d M Y H:i:s", time())." GMT"); 


// Output the image
imagejpeg($im);

// Free up memory
imagedestroy($im);
