public function __construct(Lib $backgroundImage, Lib $overlayImage) { $x = $backgroundImage->getWidth() - $overlayImage->getWidth(); $y = $backgroundImage->getHeight() - $overlayImage->getHeight(); parent::__construct($x, $y); }
public function crop(Size $size, Position $position) { imagecrop($this->resource, [$position->getX(), $position->getY(), $size->getWidth(), $size->getHeight()]); }