public function join(self $secondImage, $position = self::RightBottom)
    {
        if($secondImage->Width > $this->Width || $secondImage->Height > $this->Height) {
            throw new ImageException("Cannot insert bigger {$secondImage} into smaller {$this}.", ImageException::OutOfRangeException);
        }
        switch ($position) {
            case self::LeftTop:
                $x = 0; // left
                $y = 0; // top
                break;
            case self::CenterTop:
                $x = $this->width / 2 - $secondImage->Width / 2; // center
                $y = 0; // top
                break;
            case self::RightTop:
                $x = $this->width - $secondImage->Width; // right
                $y = 0; // top
                break;
            case self::LeftCenter:
                $x = 0; // left
                $y = $this->height / 2 - $secondImage->Height / 2; // center
                break;
            case self::CenterCenter:
                $x = $this->width / 2 - $secondImage->Width / 2; // center
                $y = $this->height / 2 - $secondImage->Height / 2; // center
                break;
            case self::RightCenter:
                $x = $this->width - $secondImage->Width; // right
                $y = $this->height / 2 - $secondImage->Height / 2; // center
                break;
            case self::LeftBottom:
                $x = 0; // left
                $y = $this->height - $secondImage->Height; // bottom
                break;
            case self::CenterBottom:
                $x = $this->width / 2 - $secondImage->Width / 2; // center
                $y = $this->height - $secondImage->Height; // bottom
                break;
            case self::RightBottom:
                $x = $this->width - $secondImage->Width; // right
                $y = $this->height - $secondImage->Height; // bottom
                break;
            default:
                throw new ImageException("Position " . $position . " not found.", ImageException::OutOfRangeException);
                break;
        }
        imagecopy($this->resource, $secondImage->Resource, $x, $y, 0, 0, $secondImage->Width, $secondImage->Height);
    }