This PHP function copies one image on to another and merges them to whatever parameter you assign. There are 9 parameters in all.
1The destination image your copying to.
2The source image your copying from.
3The X coordinate you want to copy to on destination.
4The Y coordinate you want to copy to. Area on destination image.
5The X coordinate you want to copy from. Area of source image.
6The Y coordinate you want to copy from. Area of source image.
7The width of the source image you want to copy. Bottom right corner.
8The height of the source image you want to copy. Bottom right corner.
9The merge amount. 0=none. Source image remains intact. 100=all Overwrite source picture fully. 50=merge. Mix colors equally.
The command looks like this:

imagecopymerge($destination, $source, 0, 0, 0, 0, 300, 300, 50);
To test this command I created two gradient images from the gradient codes Sally has provided. The first one is a horizontal gradient jpg, 300x300. Click on image to enlarge.gradient
Here is the php code that I used to do this:
Next I made another gradient using the rotated version of the first. Again a 300x300 jpg.gradient
Here is the PHP text for that.
Next I merged these two images and got this.gradient
Here is the PHP script to get that image.
Then I took that image and used it as a Tile to fill a circle and got this.gradient circle
Here is the PHP script to do that.
In order to tile the circle you do need a Tile that is equal or larger than the circle it is intended to tile or you will get some black lines where the image repeats its tiling. If you want a copy of all these files they can be found in this zip file. If you just want the imagecopymerge file just CCP this TEXT and change it to php: ZIP download

It is possible to merge more than one image on to a background, and similarly, more than one time, in one script. I took the following three images.
Here's the code to put them all together into this image.
ZIP File

I played around with the following images to get some idea of what is possible and how the parameters work. I used two images.
For the parameters, the first two numbers are the x,y on the background image where you want to begin the merge. The second two numbers are the x,y of the top image. The third set of x,y numbers are the lower x,y of the top image. (regardless of where I want it to fall on the background, it's just the size of the smaller image). The last number is color merge (0-100).
The first image was done with a png circle which did not show the color of the heart at all. So I changed to a gif circle and got the second image.
The circle is 300x300. The heart is 200x200. Used these parameters:
imagecopymerge($circle, $heart, 50, 50, 0, 0, 200, 200, 50)
Then I did some multiple heart merges and got these images.
TXT FileTXT File

Valid HTML 4.0 Transitional