DJ Mike's Tutorials: PHP

Imagemagick Functions


^

Description:
bool Imagick::clutImage ( Imagick $lookup_table [, int $channel ] )

Replaces colors in the image from a color lookup table. Optional second parameter to replace colors in a specific channel. This method is available if Imagick is compiled against ImageMagick 6.3.5-7 or newer.
Parameters
lookup_table
Imagick object containing the color lookup table
channel
The Channeltype constant. When not supplied, all channels are replaced.
Channel constants:
imagick::CHANNEL_UNDEFINED
imagick::CHANNEL_RED
imagick::CHANNEL_GRAY
imagick::CHANNEL_CYAN
imagick::CHANNEL_GREEN
imagick::CHANNEL_MAGENTA
imagick::CHANNEL_BLUE
imagick::CHANNEL_YELLOW
imagick::CHANNEL_ALPHA
imagick::CHANNEL_OPACITY
imagick::CHANNEL_MATTE
imagick::CHANNEL_BLACK
imagick::CHANNEL_INDEX
imagick::CHANNEL_ALL
Return Values
Returns TRUE on success.

Example


+

=

<?php
$image 
= new Imagick("opossum.jpg");
$clut = new Imagick("rainbow.gif");
$image->clutImage$clut );
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>