Example
function createFromBuiltIn($kernelType, $kernelFirstTerm, $kernelSecondTerm, $kernelThirdTerm)
{
$string = '';
if ($kernelFirstTerm != false && strlen(trim($kernelFirstTerm)) != 0) {
$string .= $kernelFirstTerm;
if ($kernelSecondTerm != false && strlen(trim($kernelSecondTerm)) != 0) {
$string .= ','.$kernelSecondTerm;
if ($kernelThirdTerm != false && strlen(trim($kernelThirdTerm)) != 0) {
$string .= ','.$kernelThirdTerm;
}
}
}
$kernel = ImagickKernel::fromBuiltIn(
$kernelType,
$string
);
return $kernel;
}
function fromBuiltIn($kernelType, $kernelFirstTerm, $kernelSecondTerm, $kernelThirdTerm)
{
$diamondKernel = createFromBuiltIn($kernelType, $kernelFirstTerm, $kernelSecondTerm, $kernelThirdTerm);
$imagick = renderKernel($diamondKernel);
header("Content-Type: image/png");
echo $imagick->getImageBlob();
}