private function setBackgroundColor($backgroundColor)
    {
        $this->backgroundColor = (int)$backgroundColor;
        $tmpImage = imagecreatetruecolor($this->width, $this->height);
        imagefilledrectangle($tmpImage, 0, 0, $this->width, $this->height, $this->backgroundColor);
        imagecopy($tmpImage, $this->resource, 0, 0, 0, 0, $this->width, $this->height);
        $this->resource = $tmpImage;
    }