PHP 8.5.0 RC 2 available for testing

Imagick::filter

(PECL imagick 3 >= 3.3.0)

Imagick::filter β€” Applies a custom convolution kernel to the image

Π£Π²Π°Π³Π°

Ця функція ЗАБВАРІЛА ΠΏΠΎΡ‡ΠΈΠ½Π°ΡŽΡ‡ΠΈ Π· Imagick 3.4.4. Π’ΠΊΡ€Π°ΠΉ Π½Π΅ Ρ€Π΅ΠΊΠΎΠΌΠ΅Π½Π΄ΡƒΡ”Ρ‚ΡŒΡΡ Π½Π° Π½Π΅Ρ— покладатися.

Опис

public Imagick::filter(ImagickKernel $ImagickKernel, int $channel = Imagick::CHANNEL_UNDEFINED): bool

Applies 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();
}

?>

οΌ‹add a note

User Contributed Notes 2 notes

up
0
wangzh at dingl dot me ΒΆ
8 years ago
-----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()!';
}
up
0
wangzh at dingl dot me ΒΆ
8 years ago
-----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
To Top