Imagick::recolorImage

(PECL imagick 2 >= 2.3.0, PECL imagick 3)

Imagick::recolorImageRecolorear la imagen

Advertencia

This function has been DEPRECATED as of Imagick 3.4.4. Relying on this function is highly discouraged.

Descripción

public Imagick::recolorImage(array $matrix): bool

Traduce, escala, recorta y rota los colores de la imagen. Este método soporta matrices variables de escalado, pero normalmente, se utiliza una matriz 5x5 para RGBA y una matriz 6x6 para CMYK. La última línea debe contener los valores normalizados. Este método está disponible si Imagick ha sido compilado con la versión 6.3.6 o superior de ImageMagick.

Parámetros

matrix

La matriz que contiene los valores de los colores.

Valores devueltos

Devuelve true en caso de éxito.

Ejemplos

Ejemplo #1 Ejemplo con Imagick::recolorImage()

<?php
function recolorImage($imagePath) {
$imagick = new \Imagick(realpath($imagePath));
$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/jpg");
echo
$imagick->getImageBlob();
}

?>

Ver también

add a note

User Contributed Notes 1 note

up
1
softmixt at gmail dot com
12 years ago
Simple example :

<?php

$image
= new Imagick('test.jpg');

$CMYK_color_model = array(0,100,0,0);

$image->recolorImage($CMYK_color_model) ;

header('Content-type: image/jpg');

echo
$image
?>
To Top