I am trying to blur an image and need a faster solution.
This is my current attempt which is much too slow for large images and I do not want to use imagick.
public function blur($filename, $extension, $factor = 20){
if (strtolower($extension) === "jpg" || strtolower($extension) === "jpeg") $image = imagecreatefromjpeg($filename);
if (strtolower($extension) === "png") $image = imagecreatefrompng($filename);
for ($x=1; $x<=$factor; $x++)
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
imagejpeg($image, "$filename.blur.$extension");
imagedestroy($image);
}
Is there a PHP implementation of stackblur or another fast algorithm available?