<?php
namespace Grafika\Imagick\Filter;
use Grafika\FilterInterface;
use Grafika\Imagick\Image;
class Brightness implements FilterInterface{
protected $amount;
/**
* Brightness constructor.
* @param int $amount The amount of brightness to apply. >= -100 and <= -1 to darken. 0 for no change. >= 1 and <= 100 to brighten.
*/
public function __construct($amount)
{
$this->amount = (int) $amount;
}
public function apply( $image ) {
$image->getCore()->modulateImage(100 + $this->amount, 100, 100);
return $image;
}
}