protected function gdImageBackground($image, $bgcolor){

		if( $bgcolor == 'transparent' ){
			imagesavealpha($image,true);
			$bgcolor1 = imagecolorallocatealpha($image, 255, 255, 255, 127);

		}else{
			list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x");
			$bgcolor1 = imagecolorallocate($image, $r, $g, $b);
		}

		imagefill($image, 0, 0, $bgcolor1);
	}
protected function gdImageBackground($image, $bgcolor){

		if( $bgcolor == 'transparent' ){
			imagesavealpha($image,true);
			$bgcolor1 = imagecolorallocatealpha($image, 255, 255, 255, 127);

		}else{
			list($r, $g, $b) = sscanf($bgcolor, "#%02x%02x%02x");
			$bgcolor1 = imagecolorallocate($image, $r, $g, $b);
		}

		imagefill($image, 0, 0, $bgcolor1);
	}
protected function gdImageBackground ( $ image , $ bgcolor ) { if ( $ bgcolor == 'transparent' ) { imagesavealpha ( $ image , true ) ; $ bgcolor1 = imagecolorallocatealpha ( $ image , 255 , 255 , 255 , 127 ) ; } else { list ( $ r , $ g , $ b ) = sscanf ( $ bgcolor , "#%02x%02x%02x" ) ; $ bgcolor1 = imagecolorallocate ( $ image , $ r , $ g , $ b ) ; } imagefill ( $ image , 0 , 0 , $ bgcolor1 ) ; }
Assign the proper background to a gd image

@param resource $image gd image resource
@param string $bgcolor background color in #rrggbb format
Assign the proper background to a gd image