I just knocked this together - it's only a thirty-second cheapy but it applies a sinusoidal distortion to a given image.
$image = imagecreatefrompng('c:\bsod.png');
$w = imagesx($image);
$h = imagesy($image);
$amplitude = 30;
$wavelength = 20;
$newimage = imagecreate($w, $h+2*$amplitude);
for($x=0; $x<$w; $x++)
{
$offset = $amplitude*sin($x/$wavelength);
imagecopy($newimage, $image, $x, $amplitude+$offset, $x, 0, 1, $h);
}
imagepng($newimage, 'bsoddd.png');