public function resize($widthOrDimensions, $height = null, $useResampling = true) {
		if(is_object($widthOrDimensions) && $widthOrDimensions instanceof Dimensions) {
			$y = $widthOrDimensions->height;
			$x = $widthOrDimensions->width;
		} else {
			$x = $widthOrDimensions;
			$y = $height;
		}
		$newImage = imagecreatetruecolor($x, $y);
		if($useResampling) {
			imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $x, $y, $this->width, $this->height);
		} else {
			imagecopyresized($newImage, $this->image, 0, 0, 0, 0, $x, $y, $this->width, $this->height);
		}
		$this->image = $newImage;
		$this->getSize();
		return $this;
	}