Imagick::recolorImage

(No version information available, might only be in Git)

Imagick::recolorImageRecolors image

说锟斤拷

Imagick::recolorImage ( array $matrix ) : bool

Translate, scale, shear, or rotate image colors. This method supports variable sized matrices but normally 5x5 matrix is used for RGBA and 6x6 is used for CMYK. The last row should contain the normalized values. 锟剿凤拷锟斤拷锟斤拷Imagick锟斤拷锟斤拷ImageMagick 6.3.6锟斤拷锟较版本锟斤拷锟斤拷时锟斤拷锟矫★拷

锟斤拷锟斤拷

matrix

The matrix containing the color values

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷

锟轿硷拷

锟斤拷锟斤拷

Example #1 Imagick::recolorImage()

<?php
function recolorImage($imagePath) {
    
$imagick = new \Imagick(realpath($imagePath));
    
$remapColor = [ 100,
        
001,
        
010,];

//$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/jpg");
    echo 
$imagick->getImageBlob();
}

?>