Replaces colors in the image using a Hald lookup table. Hald images can be created using HALD color coder.
Generate hald palette with `convert hald:8 hald_8.png`
Touch/mouse over to see original View modified in new window.
Image
Replaces colors in the image using a Hald lookup table. Hald images can be created using HALD color coder.
Parameters
clutImagickImagick object containing the Hald lookup image.
channelintImagick channel constant;
function haldClutImage($imagePath)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagickPalette = new \Imagick(realpath("images/hald/hald_8.png"));
    $imagickPalette->sepiatoneImage(55);
    $imagick->haldClutImage($imagickPalette);
    header("Content-Type: image/jpg");
    echo $imagick->getImageBlob();
}