acey99
06-09-2005, 04:13 PM
ok I have 2 images one with all of it's colors.
what I want to do is load that image with a script
eg :
[php]
# call this "overlay.php"
Header("Content-type: image/jpeg");
$im=imagecreatefromjpeg($Image);
define("WHITE",ImageColorAllocate($im, 0xFF,0xFF,0xFF));
define("BLACK",ImageColorAllocate($im, 0x0,0x0,0x0));
$fgColor=WHITE;
if ($color) {
$red=hexdec(substr($color,0,2));
$green=hexdec(substr($color,2,2));
$blue=hexdec(substr($color,4,2));
$fgColor=ImageColorAllocate($im, $red,$green,$blue);
}
# SOMETHING HERE
imagejpeg($im,'',80);
imagedestroy($im);
[\php]
but I want all of the colors in the original image to be replaced by the color sent to the script
eg : <img src="overlay.php?Image=SOMEIMAGE&color=FF0000" ... >
then output that image with the color (red in this case) over it.
any ideas with GD or imagemagick ?
what I want to do is load that image with a script
eg :
[php]
# call this "overlay.php"
Header("Content-type: image/jpeg");
$im=imagecreatefromjpeg($Image);
define("WHITE",ImageColorAllocate($im, 0xFF,0xFF,0xFF));
define("BLACK",ImageColorAllocate($im, 0x0,0x0,0x0));
$fgColor=WHITE;
if ($color) {
$red=hexdec(substr($color,0,2));
$green=hexdec(substr($color,2,2));
$blue=hexdec(substr($color,4,2));
$fgColor=ImageColorAllocate($im, $red,$green,$blue);
}
# SOMETHING HERE
imagejpeg($im,'',80);
imagedestroy($im);
[\php]
but I want all of the colors in the original image to be replaced by the color sent to the script
eg : <img src="overlay.php?Image=SOMEIMAGE&color=FF0000" ... >
then output that image with the color (red in this case) over it.
any ideas with GD or imagemagick ?