Jump to content

Help using GD/PHP


xxhopeful

Recommended Posts

I am currently working on creating a script that will allow people to pick a certain hex code, and an image will appear that is the color they selected. I believe you need to use some GD for this, I may be wrong but thats why I'm here! Heres an example of my script:

 

$base = @imagecreate(397, 500); 
$background_color = imagecolorallocate($base, 250, 255, 255); 

$body = imagecreatefromgif('images/base.gif');
imagecolortransparent($body); 
imagecopymerge ($base, $body, '0', '0', '0', '0', '397', '500', '100'); 
imagedestroy($body); 

$part1 = imagecreatefromgif('images/partone.gif');
imagecolortransparent($part1); 
imagecopymerge ($base, $part1, '0', '0', '0', '0', '397', '500', '100'); 
imagedestroy($part1); 

imagegif($base,'images/test.gif');
imagedestroy($base); 

 

This all works fine, I just don't know how to code it so the $body image would be able to turn black or gray and then the $part1 image could turn green or purple (just examples). Any suggestions? I tried looking through tutorials but nothing helped. Thanks!

Link to comment
https://forums.phpfreaks.com/topic/62375-help-using-gdphp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.