public function setBackgroundColor($color) { //create canvas $canvas = $this->generateCanvas($this->getWidth(), $this->getHeight(), $color); //merge the background canvas with the main picture $this->mergeImage($canvas); return $this; }