kernelgpf Posted October 22, 2007 Share Posted October 22, 2007 I have a script that layers two images together, and it's working perfectly, except the base image is being "negativizied"? O_o You can see it here- http://www.dragon-dynasty.com/test2.php The hair is perfect, but the actual fairy base is the negative version.. it should look like this: http://dragon-dynasty.com/Etc/fairypics/femalefairyfinal.png Here's my script- <?php $v=$_SERVER["DOCUMENT_ROOT"]; // The header line informs the server of what to send the output // as. In this case, the server will see the output as a .png // image and send it as such header ("Content-type: image/png"); // Defining the background image. Optionally, a .jpg image could // could be used using imagecreatefromjpeg, but I personally // prefer working with png $background = imagecreatefrompng("$v/Etc/fairypics/femalefairyfinal.png"); // Defining the overlay image to be added or combined. $insert2 = imagecreatefrompng("$v/Etc/fairypics/stuff/cuteheadfemale1.png"); // Select the first pixel of the overlay image (at 0,0) and use // it's color to define the transparent color imagecolortransparent($insert2,imagecolorat($insert2,0,0)); // Combine the images into a single output image. Some people // prefer to use the imagecopy() function, but more often than // not, it sometimes does not work. (could be a bug) imagecopymerge($background,$insert2,0,0,0,0,400,400,100); // Output the results as a png image, to be sent to viewer's // browser. The results can be displayed within an HTML document // as an image tag or background image for the document, tables, // or anywhere an image URL may be acceptable. imagepng($background); //,"",100 ?> Quote Link to comment https://forums.phpfreaks.com/topic/74354-solved-the-negative-of-an-image-being-shown-instead-of-just-the-image-help-asap/ Share on other sites More sharing options...
kernelgpf Posted October 22, 2007 Author Share Posted October 22, 2007 Bump. Quote Link to comment https://forums.phpfreaks.com/topic/74354-solved-the-negative-of-an-image-being-shown-instead-of-just-the-image-help-asap/#findComment-375762 Share on other sites More sharing options...
kernelgpf Posted October 23, 2007 Author Share Posted October 23, 2007 Bump. Quote Link to comment https://forums.phpfreaks.com/topic/74354-solved-the-negative-of-an-image-being-shown-instead-of-just-the-image-help-asap/#findComment-376150 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.