DJ Mike's Tutorials: PHP

Imagick Functions

^

randomThresholdImage

Description:
bool Imagick::randomThresholdImage ( float $low , float $high [, int $channel ] )

Changes the value of individual pixels based on the intensity of each pixel compared to threshold. The result is a high-contrast, two color image.
Parameters:
low
high
channel
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
header
("Content-type: image/jpeg");
$image = new Imagick("opossum.jpg"); 
# find max
$max $image->getQuantumRange(); 
$max $max[quantumRangeLong];
$image->randomthresholdImage.6*$max.4*$max );
echo 
$image;
?> 


<?php
header
("Content-type: image/jpeg");
$image = new Imagick("opossum.jpg"); 
# find max
$max $image->getQuantumRange(); 
$max $max[quantumRangeLong];
$image->randomthresholdImage.4*$max.6*$max );
echo 
$image;
?> 


<?php
$image 
= new Imagick("opossum.jpg"); 
# find max
$max $image->getQuantumRange(); 
$max $max[quantumRangeLong];
$image->randomthresholdImage.4*$max.6*$maximagick::CHANNEL_RED );
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>