/**
  * {@inheritdoc}
  */
 public function apply(ImageInterface $image)
 {
     $image->usePalette($this->palette)->strip();
     if (is_callable($this->path)) {
         $path = call_user_func($this->path, $image);
     } elseif (null !== $this->path) {
         $path = $this->path;
     } else {
         return $image;
     }
     return $image->save($path, $this->options);
 }