Forum Moderators: coopster

Message Too Old, No Replies

Create from multiple images with GD2

Multiple images with gd

         

DooinMyHeadIn

7:24 pm on Sep 14, 2004 (gmt 0)

10+ Year Member



Hi all

Im currently writing a script using GD2. The image I am creating consists of one rectagle with a fill colour and two images, both with a transparent bg to be merged with it. I have the rectangle and one image displaying perfectly well, yet when the second image is added the colors alter somewhat with a greenish hue. The initial rectangle is made up from imagecreate() and the other 2 images are png. I used imagecopymerge() to combine the first two images into one, and then the same function to toke the new image and merge the third. I have tried many function for adjusting the alpha and also the gama, but have not yet found a way to retain colors of the third and final image. I have also tried using png8 images to no avail.

All suggestions most gratefully appreciated.

mincklerstraat

6:42 am on Sep 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try making all images with imagecreatetruecolor(); - this creates an image that has a 'true color' (bigger) color palette. This might be what's keeping your images from being colored as you wish them to be, the smaller pallette of imagecreate() is reducing the range of colors to its own palette.

DooinMyHeadIn

9:22 am on Sep 15, 2004 (gmt 0)

10+ Year Member



Thanks for the reply. I shall try this. I only have one image generated tottally on the fly and I can combine an existing png with it, the problem comes when trying to add 2 or more.

Thanks again.

DooinMyHeadIn

7:45 pm on Sep 16, 2004 (gmt 0)

10+ Year Member



**SOLVED IT MYSELF**

The solution is to write out an IE bug that prevents the browser from correctly resolving opacity.

ergophobe

8:08 pm on Sep 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Care to elaborate? What's the bug and how did you get around it?

Thanks,

Tom