Applies a wave filter to the image. This method is available if Imagick has been compiled against ImageMagick version 6.2.9 or newer.
function waveImage($image_path, $amplitude, $length)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->waveImage($amplitude, $length);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}