Supported Versions: PHP 5, PHP 7, PHP 8
Applies a filter to an image
<?php imagefilter(GdImage $image, int $filter, array|int|float|bool ...$args): bool
<?php $amount = $this->argument(0)->between(0, 100)->value(1);
for ($i=0; $i < intval($amount); $i++) {
imagefilter($image->getCore(), IMG_FILTER_GAUSSIAN_BLUR);
}
return true;
<?php {
$level = $this->argument(0)->between(-100, 100)->required()->value();
return imagefilter($image->getCore(), IMG_FILTER_BRIGHTNESS, ($level * 2.55));
}
}
<?php $blue = round($blue * 2.55);
return imagefilter($image->getCore(), IMG_FILTER_COLORIZE, $red, $green, $blue);
}
}
<?php {
$level = $this->argument(0)->between(-100, 100)->required()->value();
return imagefilter($image->getCore(), IMG_FILTER_CONTRAST, ($level * -1));
}
}
<?php public function execute($image)
{
return imagefilter($image->getCore(), IMG_FILTER_GRAYSCALE);
}
}
<?php public function execute($image)
{
return imagefilter($image->getCore(), IMG_FILTER_NEGATE);
}
}
<?php if ( ! $mask_w_alpha) {
imagefilter($mask->getCore(), IMG_FILTER_GRAYSCALE);
}
<?php {
$size = $this->argument(0)->type('digit')->value(10);
return imagefilter($image->getCore(), IMG_FILTER_PIXELATE, $size, true);
}
}