Hi,
Not been around for a while - feel like I've missed loads of good stuff!
On to my question:
Is it possible to create an image using PHP that is a composite/amalgam of other smaller images?
One absolute MUST criterion is that it must support the smaller images' transparency layer (only one, they are GIF's). I don't mind what format the composite image is in, although the image types include lots of blocks of single colours, so I guess that GIF or PNG would be best.
Thanks in advance.
Creating a composite image server-side
Moderator: General Moderators
From http://www.php.net/image:
imagecopymerge() may be the function you are looking for. Look at the last comment, it seems to have a function that you may be able to put to use if you add some of the alpha blending code shown in the first comment.
Also, if you can install a library onto the server you are using, you should look into Image Majick. One of the features listed on the site is "Create a composite image by combining several separate images."
If you decided to use Image Majick this link maybe helpful too: http://pecl.php.net/package/imagick
GIF support was stopped because of Unisys LZW patent that doesn't expire until July 7th, 2004. You may want to go with PNG if you want the most current version of GD.gif:
Only supported in GD versions older than gd-1.6. Read-only GIF support is available with PHP 4.3.0 and the bundled GD-library.
png:
library: http://www.libpng.org/pub/png/libpng.html
Only supported in GD versions greater than gd-1.6.
imagecopymerge() may be the function you are looking for. Look at the last comment, it seems to have a function that you may be able to put to use if you add some of the alpha blending code shown in the first comment.
Also, if you can install a library onto the server you are using, you should look into Image Majick. One of the features listed on the site is "Create a composite image by combining several separate images."
If you decided to use Image Majick this link maybe helpful too: http://pecl.php.net/package/imagick