adaptivethresholdImage ( $adaptivethreshold_width, $adaptivethreshold_height, $adaptivethreshold_offset ); } $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $_SESSION[path] = $path; $_SESSION[adaptivethreshold_width] = $adaptivethreshold_width; $_SESSION[adaptivethreshold_height] = $adaptivethreshold_height; $_SESSION[adaptivethreshold_offset] = $adaptivethreshold_offset; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings header("location:display.php"); exit; } ######### end Adaptive Threshold ######### ############ Threshold ########### if ( $_GET[threshold] || $_GET[blackthreshold] || $_GET[whitethreshold] ) { ## validate color $threshold_color = trim($_GET[threshold_color] ); $threshold_color = colors( $threshold_color, "validate" ); if ( !$threshold_color ) { $_SESSION[error] = "Color is invalid"; header("location:$self"); exit; } ## end validate $image = new Imagick($_SESSION[path]); if ( $_GET[blackthreshold] || $_GET[threshold] ) { foreach ($image as $frame) { $frame->blackthresholdImage( $threshold_color ); } } if ( $_GET[whitethreshold] || $_GET[threshold] ) { foreach ($image as $frame) { $frame->whitethresholdImage( $threshold_color ); } } $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $_SESSION[path] = $path; $_SESSION[threshold_color] = $threshold_color; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings header("location:display.php"); exit; header("Location: display.php"); exit; } ################ End Threshold ########### include("top.php"); ?>
Threshold Color: ">
Width: "> Height: "> Offset: ">

Enter a threshold color. Color can be a named color or hex. Examples: red, #0000ff

Threshold
Create a high contrast, two tone image divided by the threshold color.
Black Threshold
Forces all pixels below the threshold color into black while leaving all pixels above the threshold unchanged.
White Threshold
Forces all pixels above the threshold color into white while leaving all pixels below the threshold unchanged,
Adaptive Threshold
Selects an individual threshold for each pixel based on the range of intensity values in its local neighborhood. This allows for thresholding of an image whose global intensity histogram doesn't contain distinctive peaks.
Parameters:
Width
Width of the local neighborhood.
Height
Height of the local neighborhood.
Offset
The mean offset.