It is impossible to set a white background, the picture is obtained at the output with a black background:

$img=imagecreatetruecolor(1920,1080); $background=imagecolorallocate($img, 255,255,255); 

    1 answer 1

    Try this:

    $white = imagecolorallocate($img, 255, 255, 255); imagefill($img, 0, 0, $white);