Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct(function (ImageInterface $image, Point $point) {
         $color = $image->getColorAt($point);
         $image->draw()->dot($point, $color->grayscale());
     });
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct(function (ImageInterface $image, Point $point) {
         $color = $image->getColorAt($point);
         $gray = min(255, round(($color->getRed() + $color->getBlue() + $color->getGreen()) / 3));
         $image->draw()->dot($point, new Color(array('red' => $gray, 'green' => $gray, 'blue' => $gray)));
     });
 }