Skip to content
Related Articles
Open in App
Not now

Related Articles

PHP | Imagick adaptiveThresholdImage() Function

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 26 Aug, 2019
Improve Article
Save Article

The Imagick::adaptiveThresholdImage() function is an inbuilt function in PHP which is used to select a threshold for each pixel based on intensity values in its local neighborhood. This function allows to thresholding of an image whose global intensity histogram doesn’t contain distinctive peaks.


bool Imagick::adaptiveThresholdImage ( $width, $height, $offset )

Parameters: This function accepts three parameters as mentioned above and described below:

  • $width: This parameter is used to set the width of local neighborhood.
  • $height: This parameter is used to set the height of local neighborhood.
  • $offset: This parameter is used to set mean offset.

Return Value: This function returns TRUE on success.

Below program illustrate the Imagick::adaptiveThresholdImage() function in PHP:

Original Image:
original image


// require_once('path/to/vendor/autoload.php'); 
header('Content-type: image/png');
$image = new Imagick(
$image->adaptiveThresholdImage(1024, 73, 0.625);
echo $image;

adaptive thresold image


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!