/** * @param \DarkLuk42\BoundingBox $bb the area to be cropped * * @return \DarkLuk42\Image the new cropped image */ public function crop(BoundingBox $bb) { $image = new self($bb->getWidth(), $bb->getHeight(), $this->getBackgroundColorObject()); $image->copyResampled($this, BoundingBox::createFromImage($image), $bb); return $image; }