I was on another PC before and I hadn't the code.
Now I'm on my PC and I can post it.
<?php
session_start();
header("Content-type: image/png");
$font = "courbi.ttf";
$image = imagecreate(200,60);
$background_color = ImageColorAllocate($image, rand(0,120), rand(0,120), rand(0,120));
$colour1 = ImageColorAllocate($image, rand(120,255), rand(120,255), rand(120,255));
imagettftext($image,26,0,30,40,$colour1,$font,$_SESSION['captcha']);
imagefilter($image,IMG_FILTER_GAUSSIAN_BLUR);
$scale = 2;
$width = 200;
$height = 60;
$xperiod = 10;
$xamplitude = 5;
$yperiod = 12;
$yamplitude = 14;
// X-axis wave generation
$xp = $scale*$xperiod*rand(1,3);
$k = rand(0, 100);
for ($i = 0; $i < ($width*$scale); $i++) {
imagecopy($image, $image,
$i-1, sin($k+$i/$xp) * ($scale*$xamplitude),
$i, 0, 1, $height*$scale);
}
// Y-axis wave generation
$k = rand(0, 100);
$yp = $scale*$yperiod*rand(1,2);
for ($i = 0; $i < ($height*$scale); $i++) {
imagecopy($image, $image,
sin($k+$i/$yp) * ($scale*$yamplitude), $i-1,
0, $i, $width*$scale, 1);
}
imagepng($image);
imagedestroy($image);
?>
I hope that this can be useful to someone :)