php8.5
Home/ Manual/ imagick / imagick/ Imagick::haldClutImage

Imagick::haldClutImage

PHP function Edit on GitHub ✎

(PECL imagick 3)

Replaces colors in the image

Description

Imagick::haldClutImage(Imagick $clut, int $channel = Imagick::CHANNEL_DEFAULT): bool

Replaces colors in the image using a Hald lookup table. Hald images can be created using HALD color coder.

Parameters

clut

Imagick object containing the Hald lookup image.

channel

Channel

Return Values

Success

Errors/Exceptions

Throws

Examples

Imagick::haldClutImage()

php
<?php
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();
}

?>

Source: reference/imagick/imagick/haldclutimage.xml · from the official PHP manual (php/doc-en)