Cheetah
SharpenCommand.php
Go to the documentation of this file.
1 <?php
2 
4 
6 {
13  public function execute($image)
14  {
15  $amount = $this->argument(0)->between(0, 100)->value(10);
16 
17  // build matrix
18  $min = $amount >= 10 ? $amount * -0.01 : 0;
19  $max = $amount * -0.025;
20  $abs = ((4 * $min + 4 * $max) * -1) + 1;
21  $div = 1;
22 
23  $matrix = array(
24  array($min, $max, $min),
25  array($max, $abs, $max),
26  array($min, $max, $min)
27  );
28 
29  // apply the matrix
30  return imageconvolution($image->getCore(), $matrix, $div, 0);
31  }
32 }
Intervention\Image\Gd\Commands
Definition: BackupCommand.php:3
php
Intervention\Image\Gd\Commands\SharpenCommand
Definition: SharpenCommand.php:6
Intervention\Image\Gd\Commands\SharpenCommand\execute
execute($image)
Definition: SharpenCommand.php:13
Intervention\Image\Commands\AbstractCommand\argument
argument($key)
Definition: AbstractCommand.php:45
Intervention\Image\Commands\AbstractCommand
Definition: AbstractCommand.php:6