";
foreach ($row as $cell) {
$output .= "| ";
if ($cell === false) {
$output .= "false";
}
else {
$output .= round($cell, 3);
}
$output .= " | ";
}
$output .= "
";
}
$output .= "";
return $output;
}
$matrix = [
[-1, 0, -1],
[ 0, 4, 0],
[-1, 0, -1],
];
$kernel = \ImagickKernel::fromMatrix($matrix);
$kernel->scale(4, \Imagick::NORMALIZE_KERNEL_VALUE);
$diamondKernel = \ImagickKernel::fromBuiltIn(
\Imagick::KERNEL_DIAMOND,
"2"
);
$kernel->addKernel($diamondKernel);
$kernelList = $kernel->separate();
$output = '';
$count = 0;
foreach ($kernelList as $kernel) {
$output .= "