public function rescale($x, $y) {
		if(is_object($x) && $x instanceof Dimensions) {
			$y = $x->height;
			$x = $x->width;
		}
		$newImage = imagecreatetruecolor($this->width * $x, $this->height * $y);
		$x = imagesx($newImage);
		$y = imagesy($newImage);
		imagecopyresampled($newImage, $this->image, 0, 0, 0, 0, $x, $y, $this->width, $this->height);
		$this->image = $newImage;
		$this->getSize();
		return $this;
	}