-1 | 0 | -1 |
0 | 4 | 0 |
-1 | 0 | -1 |
false | false | 1 | false | false |
false | 1 | 1 | 1 | false |
1 | 1 | 1 | 1 | 1 |
false | 1 | 1 | 1 | false |
false | false | 1 | false | false |
$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 .= "<br/>Kernel $count<br/>"; $output .= Display::renderKernelTable($kernel->getMatrix()); $count++; } return $output;