/**
  * {@inheritdoc}
  */
 protected function doApply(CanvasInterface $canvas)
 {
     $copy = $canvas->getCopy();
     // convert copy to black and white
     $baw = new BlackAndWhite();
     $baw->apply($copy);
     // overlay the canvas with the black and white copy
     $overlay = new Overlay($copy, $this->getLevel());
     $overlay->apply($canvas);
     $copy->destroy();
 }
 /**
  * {@inheritdoc}
  */
 protected function doApply(CanvasInterface $canvas)
 {
     $copy = $canvas->getCopy();
     $this->isInvert() ? $this->getAction()->apply($canvas) : $this->getAction()->apply($copy);
     // do the magic
     $canvas->paste($copy, $this->getBox(), $this->getBox());
     // destroy the copy
     $copy->destroy();
 }
 /**
  * {@inheritdoc}
  */
 public function fromCanvas(CanvasInterface $canvas)
 {
     $copy = $canvas->getCopy();
     $this->forceDestory();
     $this->setHandler($copy->getHandler());
     return $this;
 }