HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelTutorial Source codeReport an issue
Category
Example

Imagick::motionBlurImage

← mosaicImages   negateImage →
Simulates motion blur. We convolve the image with a Gaussian operator of the given radius and standard deviation (sigma). For reasonable results, radius should be larger than sigma. Use a radius of 0 and MotionBlurImage() selects a suitable radius for you. Angle gives the angle of the blurring motion.
function motionBlurImage($image_path, $radius, $sigma, $angle, $channel)
{
    $imagick = new \Imagick(realpath($image_path));
    $imagick->motionBlurImage($radius, $sigma, $angle, $channel);
    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}