Change "HUE" of an image with PHP GD Library?
<p>I'd like to change the "hue" of an image using the PHP image processing functions. Which is the correct filter to apply?</p>

<p>Note: I'm from a photoshop background, so in the event my interpretation of "hue" is different from others, here's what I mean...</p>

<p>In photoshop, you can use the "Hue" filter to change the color of an image without actually affecting the design of the image.</p>

<p>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.</p>

<pre><code> 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);
 }
 ?&gt;
</code></pre>
