This question already has an answer here:
I use gaussian blur. 1 line of
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
doesn't give the desired blur intensity. So I need to use it like 30 times. This is an unprofessional way, it increases the page load time a lot when there are many images on the page. So is there any better/smarter way for image blur ?
$image = imagecreatefromjpeg("caski_m.jpg");
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
header("content-type: image/jpeg");
imagepng($image);
imagedestroy($image);
</div>
If you are searching more concise and elegant solution then:
ImageMagick
extension for php
exec
command to invoke ImageMagick convert operator:Schema: exec("convert <your_image_name> -blur <blur_level> <your_blured_image_name> ");
You can adjust blur level flexibly.
Example: exec("convert '$image' -blur 0x8 'blur_' . $image");
But don't forget to specify accesible image path.
To get more options look at the following: imagick_blur_guide