I'd like to change the "hue" of an image using the PHP image processing functions. Which is the correct filter to apply?
Note: I'm from a photoshop background, so in the event my interpretation of "hue" is different from others, here's what I mean...
In photoshop, you can use the "Hue" filter to change the color of an image without actually affecting the design of the image.
I'm currently using the function below to recolor my images, but the function fails to meet my needs due to the fact that it completely repaints the image, losing the design.
function set_theme_color_header($hex)
{
$info = hexToRGB($hex); //utility function that converts hex to rgb
$token = "header.gif";
$img = imagecreatefromgif("header-template.gif";
$color = imagecolorallocate($img, $info["red"], $info["green"], $info["blue"]);
imagecolorset($img, 0, $info["red"], $info["green"], $info["blue"]);
imagegif($img, $token);
}
?>