我想使用PHP图像处理功能更改图像的"色调".哪个是适用的正确过滤器?
注意:我来自Photoshop的背景,所以如果我对"色调"的解释与其他不同,这就是我的意思......
在Photoshop中,您可以使用"Hue"滤镜来更改图像的颜色,而不会实际影响图像的设计.
我目前正在使用下面的功能重新着色我的图像,但由于它完全重新绘制图像,失去了设计,因此无法满足我的需求.
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);
}
?>
Run Code Online (Sandbox Code Playgroud) php ×1