DJ Mike's Tutorials: PHP

ImageMagick Functions

^

Imagick::colorizeImage

Description:
bool Imagick::colorizeImage ( mixed $colorize , mixed $opacity )

Blends the fill color with each pixel in the image.
Parameters:
colorize
ImagickPixel object or a string containing the colorize color.
opacity
ImagickPixel object or an float containing the opacity value. 1.0 is fully opaque and 0.0 is fully transparent.
Return Values
Returns TRUE on success.
Errors/Exceptions
Throws ImagickException on error.

Example



<?php
header
("Content-type: image/jpeg");
$image = new Imagick("opossum.jpg"); 
# using color object
$color = new ImagickPixel();
$color->setcolor("#0000ff");
$image->colorizeImage($color1.5);
echo 
$image;
?>

The following examples will give the same result as the example above.

<?php
$image 
= new Imagick("opossum.jpg"); 
# using color name as string
$image->colorizeImage("blue", 1.5);
header("Content-type: image/jpeg");
echo $image;
?>


<?php
$image 
= new Imagick("opossum.jpg"); 
# using color hex as string
$image->colorizeImage("#0000ff", 1.5);
header("Content-type: image/jpeg");
echo $image;
?>


^


Created by DJ Mike from Santa Barbara

DJ Mike


Dance Away Santa Barbara's Home Page
<a href="http://www.statcounter.com/" target="_blank"> <img src="http://c5.statcounter.com/counter.php?sc_project=1321035&java=0&security=da2193dc" alt="counter free hit invisible" border="0" /></a>