Convolve::arguments() has the following code.
protected function arguments() {
return [
'radius' => [
'description' => 'The radius of the Gaussian, in pixels, not counting the center pixel. Use 0 for auto-select.',
],
'sigma' => [
'description' => 'The standard deviation of the Gaussian, in pixels.',
],
'amount' => [
'description' => 'The fraction of the difference between the original and the blur image that is added back into the original.',
],
'threshold' => [
'description' => 'The threshold, as a fraction of QuantumRange, needed to apply the difference amount.',
],
];
}
Those aren't the arguments the operation uses, which is just a matrix. That is what the process() method uses.
protected function process(Imagick $resource, array $arguments) {
$matrix = [];
foreach(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($arguments['matrix'])) as $value) {
$matrix[] = $value;
}
return $resource->convolveImage($matrix);
}
The same arguments are referenced from ConvolveImageEffect::defaultConfiguration().
public function defaultConfiguration() {
return [
'radius' => '0',
'sigma' => '1',
'amount' => '1.0',
'threshold' => '0.05',
];
}
Comments
Comment #2
avpadernoComment #4
bceyssens