I am wondering what`s the best method to merge, let`s say 5 images. I also need to choose their order.
PHP image creation is quite easy and has a lot of useful methods. Go to http://www.php.net/image and you will find a list of functions you can use. Here are the basics. <?php Header ("Content-type: image/gif"); ?> Your first line of code must designate that it is, in fact, an image. Your image can be a ".php" file even if the content is of type gif, so don't worry about naming the image extension as a gif, as it is not necessary. $image1 = imageCreateFromPNG($image1Url); $image2 = imageCreateFromPNG($image2Url); This will load the images passed in to the functions. $colorTransparent = imagecolorat($image1, 0, 0); imageColorTransparent ($image1, $colorTransparent); $colorTransparent = imagecolorat($image2, 0, 0); imageColorTransparent ($image2, $colorTransparent); The above is optional, but it will take the color in the (0,0) pixel of the image and make all of that color transparent for that image. You could also use the color allocate function and pass in the arguments (red,green,blue) for the color of your choice to make transparent. Doing it this way, you will have to convert from hex to base ten. So if your color is FFFF00, r=255, b=255, g=0. imageCopyMerge($image1, $image2, 0, 0, 0, 0, 96, 96, 100); This will copy image2 on top of image1. Check the arguments at the site I listed at the top, as this is just a messy function with a lot of stuff to pass in. I know the 96's are for the dimensions and I think the 100 is the opacity of the image on top. ImagePng ($image1); This will create your image! ImageDestroy ($image1); ImageDestroy ($image2); ?> Don't forget to deallocate your memory. Hope this helps buddy. If you wanna see a sample of what I've done with PHP images click the sig link for Land of Camelot and check out my registration page. I have a character creation system so members can create their own avatar, with millions of different combinations, making the game much more dynamic.
It looks easy when you are talking about it, but it is a bit complicated on my side. I am coding a script that will generate a family. Users can choose how many parents to have (1 mother + 1 father, 1 mother, 1 father, 2 fathers, 2 mothers ) and how many children (boy and girl). Based on user input I need to put the images one next to other.