ImagickKernel::addKernel
ImagickKernel::addKernel
(PECL imagick >= 3.3.0)
ImagickKernel::addKernel — Description
Description
public void ImagickKernel::addKernel ( ImagickKernel $ImagickKernel )
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.
Parameters
ImagickKernel
Return Values
Examples
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(
}
?>
← ImagickKernel
ImagickKernel::addUnityKernel →
© 1997–2017 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://secure.php.net/manual/en/imagickkernel.addkernel.php