HomeImagickImagickDrawImagickPixelImagick Pixel IteratorImagick KernelDevelopmentTutorial Source codeReport an issue
Category
Example

Imagick::recolorImage

← readImageBlob   reduceNoiseImage →
recolorImage was removed in ImageMagick 7. Use Imagick::colorMatrixImage instead. Probably

Example

function recolorImage($image_path)
{
    $imagick = new \Imagick(realpath($image_path));
    $remapColor = [ 1, 0, 0,
        0, 0, 1,
        0, 1, 0,];

//$remapColor = [
//    1.438, -0.122, -0.016,  0, 0, -0.03,
//    -0.062,  1.378, -0.016,  0, 0,  0.05,
//    -0.062, -0.122, 1.483,   0, 0, -0.02,
//];

    @$imagick->recolorImage($remapColor);

    header("Content-Type: image/jpeg");
    echo $imagick->getImageBlob();
}