-----Imagick 3.4.3 && ImageMagick 7.0.6
-----why cannot find filter method?????
if (!method_exists(Imagick, 'filter')) {
echo 'undefined filter()οΌ';
} else {
echo 'defined filter()οΌ';
}
(PECL imagick 3 >= 3.3.0)
Imagick::filter β Applies a custom convolution kernel to the image
Π¦Ρ ΡΡΠ½ΠΊΡΡΡ ΠΠΠ‘Π’ΠΠ ΠΠΠ ΠΏΠΎΡΠΈΠ½Π°ΡΡΠΈ Π· Imagick 3.4.4. ΠΠΊΡΠ°ΠΉ Π½Π΅ ΡΠ΅ΠΊΠΎΠΌΠ΅Π½Π΄ΡΡΡΡΡΡ Π½Π° Π½Π΅Ρ ΠΏΠΎΠΊΠ»Π°Π΄Π°ΡΠΈΡΡ.
$ImagickKernel
, int $channel
= Imagick::CHANNEL_UNDEFINED): boolApplies a custom convolution kernel to the image.
ImagickKernel
An instance of ImagickKernel that represents either a single kernel or a linked series of kernels.
channel
ΠΠΎΠ½ΡΡΠ°Π½ΡΠ° ΠΊΠ°Π½Π°Π»Ρ, Π΄ΡΠΉΡΠ½Π° Π΄Π»Ρ ΠΏΠΎΡΠΎΡΠ½ΠΎΠ³ΠΎ ΡΠ΅ΠΆΠΈΠΌΡ ΠΊΠ°Π½Π°Π»Ρ. ΠΠ»Ρ Π·Π°ΡΡΠΎΡΡΠ²Π°Π½Π½Ρ ΡΡ Π΄ΠΎ
ΠΊΡΠ»ΡΠΊΠΎΡ
ΠΊΠ°Π½Π°Π»ΡΠ² Π½Π΅ΠΎΠ±Ρ
ΡΠ΄Π½ΠΎ ΠΏΠΎΡΠ΄Π½Π°ΡΠΈ ΠΊΠΎΠ½ΡΡΠ°Π½ΡΠΈ ΠΊΠ°Π½Π°Π»Ρ ΠΏΠΎΠ±ΡΡΠΎΠ²ΠΈΠΌΠΈ
ΠΎΠΏΠ΅ΡΠ°ΡΠΎΡΠ°ΠΌΠΈ. Π‘ΡΠ°Π½Π΄Π°ΡΡΠ½ΠΎ β Imagick::CHANNEL_DEFAULT
. ΠΠΈΠ².
ΡΠΏΠΈΡΠΎΠΊ ΠΊΠΎΠ½ΡΡΠ°Π½Ρ ΠΊΠ°Π½Π°Π»Ρ.
ΠΠΎΠ²Π΅ΡΡΠ°Ρ true
Π² ΡΠ°Π·Ρ ΡΡΠΏΡΡ
Ρ.
ΠΡΠΈΠΊΠ»Π°Π΄ #1 Imagick::filter()
<?php
function filter($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$matrix = [
[-1, 0, -1],
[0, 5, 0],
[-1, 0, -1],
];
$kernel = \ImagickKernel::fromMatrix($matrix);
$strength = 0.5;
$kernel->scale($strength, \Imagick::NORMALIZE_KERNEL_VALUE);
$kernel->addUnityKernel(1 - $strength);
$imagick->filter($kernel);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
?>
-----Imagick 3.4.3 && ImageMagick 7.0.6
-----why cannot find filter method?????
if (!method_exists(Imagick, 'filter')) {
echo 'undefined filter()οΌ';
} else {
echo 'defined filter()οΌ';
}
-----Imagick::filter cannot work!
-----suse linux server , imagick module version 3.4.3
-----run Example #1 Imagick::filter() , there is no result! where is problem?
thank you for your answer!
Alex