Generate hald palette with `convert hald:8 hald_8.png`
Touch/mouse over to see original View modified in new window.
Image
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();
}