public function border($color = '#000000', $thickness = 1)
    {
        // Draw border
        $rgb = $this->hex2rgb($color);

        $color = imagecolorallocate($this->image, $rgb['r'], $rgb['g'], $rgb['b']);

        $x1 = 0;
        $y1 = 0;
        $x2 = ImageSX($this->image) - 1;
        $y2 = ImageSY($this->image) - 1;

        for ($i = 0; $i < $thickness; $i++) {
            ImageRectangle($this->image, $x1++, $y1++, $x2--, $y2--, $color);
        }

        return $this;
    }