function convolveImage($image_path, $bias, $convolve_matrix) { $imagick = new \Imagick(realpath($image_path)); //$edgeFindingKernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1,]; $imagick->setImageBias($bias * \Imagick::getQuantum()); $imagick->convolveImage($convolve_matrix); header("Content-Type: image/jpeg"); echo $imagick->getImageBlob(); }