kernelgpf Posted October 23, 2007 Share Posted October 23, 2007 I edited a script to layer images together, which it's working, but it's leaving funny white pixels in random places, and I can't figure out why. Help? Here's my script- Here's the image: http://www.dragon-dynasty.com/test2.php <?php $v=$_SERVER["DOCUMENT_ROOT"]; $background = imagecreatefromjpeg("$v/Etc/fairypics/femalefairyfinal.jpg"); $insert2 = imagecreatefromjpeg("$v/Etc/fairypics/stuff/cutechestfemale1.jpg"); imagecolortransparent($insert2,imagecolorat($insert2,0,0)); imagecopymerge($background,$insert2,0,0,0,0,400,400,100); $insert3 = imagecreatefromjpeg("$v/Etc/fairypics/stuff/cuteheadfemale1.jpg"); imagecolortransparent($insert3,imagecolorat($insert3,0,0)); imagecopymerge($background,$insert3,0,0,0,0,400,400,100); header ("Content-type: image/jpeg"); imagejpeg($background); ?> Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/ Share on other sites More sharing options...
adam291086 Posted October 23, 2007 Share Posted October 23, 2007 have you tired to layer the images manually, like in photoshop to ensure the picture layer properly? Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376263 Share on other sites More sharing options...
kernelgpf Posted October 23, 2007 Author Share Posted October 23, 2007 No, I'll try it now.. Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376265 Share on other sites More sharing options...
kernelgpf Posted October 23, 2007 Author Share Posted October 23, 2007 They layer fine. I think the problem is the imagecolortransparent function is trying to erase all white, even on the girl, when I only want it to remove the white from AROUND her.. how would I do that? I tried using gif and png format.. png wouldn't work, and gif made the image look all choppy. Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376266 Share on other sites More sharing options...
kernelgpf Posted October 23, 2007 Author Share Posted October 23, 2007 Before I saved the image I removed all the white around her, but when I saved it, the white returned.. Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376268 Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 but when I saved it, the white returned.. That is because you saved it as a JPG file. If you want transparency it has to be saved as a GIF Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376274 Share on other sites More sharing options...
kernelgpf Posted October 23, 2007 Author Share Posted October 23, 2007 I got it working.. I used gif instead but manually transparentized it! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376276 Share on other sites More sharing options...
nafetski Posted October 23, 2007 Share Posted October 23, 2007 You can also use png =D Quote Link to comment https://forums.phpfreaks.com/topic/74467-solved-layering-images-leaving-strange-white-dots/#findComment-376293 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.