Okay, I'm trying to create a final image by merging several (quantity will vary) images into one. This is the code I've got, but it's totally non-functional. I know I'm doing something wrong, but I don't know what. //Define base background image $base_background = imagecreatefromgif('adr/images/misc/landscape.gif'); //Output background image $background_image = ''; //Merge imagecopy($background_image,$base_background,0,0,0,0,1000,839); //Check if image active if($mw_image) { $mw_image = imagecreatefromgif('adr/images/buildings/inner_wall_139.gif'); //Merge images imagecopy($base_background,$mw_image,0,0,0,0,1000,839); } PHP:
Your $background_image is blank, it needs to be an actual image resource, so instead of = '' needs to be something like this. $background_image = @imagecreatetruecolor(1000, 839) ; //sets background to black imagecolorallocate($background_image, 0, 0, 0); Code (markup): And you may want to use imagecopymerge and not imagecopy if you're trying to put the base background on top of the $background_image.