⇦ Back to Image classMethod filter
public \Joomla\CMS\Image\Image
filter
(mixed $type, array $options = [])
Method to apply a filter to the image by type. Two examples are: grayscale and sketchy.
Parameters
- string $type The name of the image filter to apply.
- array $options An array of options for the filter.
Returns
Since
-
- \Joomla\CMS\Image\Filter
- \LogicException
Method filter - Source code
public function filter($type, array $options = [])
{
if (!$this->isLoaded()) {
throw new \LogicException('No valid image was loaded.');
}
$filter = $this->getFilterInstance($type);
$filter->execute($options);
return $this;
}