PHP | Imagick adaptiveThresholdImage() Function
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.
Syntax:
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:

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

Reference: http://php.net/manual/en/imagick.adaptivethresholdimage.php
Recommended Posts:
- PHP | Imagick implodeImage() Function
- PHP | Imagick getCopyright() Function
- PHP | Imagick extentImage() Function
- PHP | Imagick equalizeImage() Function
- PHP | Imagick edgeImage() Function
- PHP | Imagick motionBlurImage() Function
- PHP | Imagick sharpenImage() Function
- PHP | Imagick enhanceImage() Function
- PHP | Imagick embossImage() Function
- PHP | Imagick adaptiveSharpenImage() Function
- PHP | Imagick convolveImage() Function
- PHP | Imagick pingImageBlob() Function
- PHP | Imagick paintTransparentImage() Function
- PHP | Imagick gammaImage() Function
- PHP | Imagick despeckleImage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



