(PECL imagick >= 3.3.0)
ImagickKernel::addKernel — Attach another kernel to a kernel list
Attach another kernel to this kernel to allow them to both be applied in a single morphology or filter function. Returns the new combined kernel.
ImagickKernel
Example #1 ImagickKernel::addKernel()
<?php
function addKernel($imagePath) {
$matrix1 = [
[-1, -1, -1],
[ 0, 0, 0],
[ 1, 1, 1],
];
$matrix2 = [
[-1, 0, 1],
[-1, 0, 1],
[-1, 0, 1],
];
$kernel1 = ImagickKernel::fromMatrix($matrix1);
$kernel2 = ImagickKernel::fromMatrix($matrix2);
$kernel1->addKernel($kernel2);
$imagick = new \Imagick(realpath($imagePath));
$imagick->filter($kernel1);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant