I'm trying to apply the css hue-rotate filter result in PHP
Currently I'm using Imagick
php library using the modulateImage function to change hue like this
function modulateImage($imagePath, $hue, $brightness, $saturation) {
$imagick = new \Imagick(realpath($imagePath));
$imagick->modulateImage($brightness, $saturation, $hue);
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();
}
But for some reason, applying the same value of CSS's hue-rotate
to PHP function gives me different color result, I'm not sure about the calculation used in them both/ percentage/ degree, I wish someone could explain or any alternative for them ( mostly alternative for PHP, I find CSS filter is perfect for my needs, I just need to make same applies in PHP )