PHP | Imagick orderedPosterizeImage() Function
The Imagick::orderedPosterizeImage() function is an inbuilt function in PHP which is used to performs an ordered dither based on a number of pre-defined dithering threshold maps, but over multiple intensity levels, which can be different for different channels, according to the input arguments.
Syntax:
bool Imagick::orderedPosterizeImage( $threshold_map, $channel )
Parameters: This function accepts two parameters as mentioned above and described below:
- $threshold_map: This parameter is used to containing the string name of the threshold dither map to use.
- $channel: This parameter provides the channel constant that is valid for channel mode. More then one channel can be combined using bitwise operator. The defaults channel in Imagick function is Imagick::CHANNEL_DEFAULT.
Return Value: This function returns True on success.
Errors/Exceptions: This function throws ImagickException on error.
Below program illustrates the Imagick::orderedPosterizeImage() function in PHP:
Program:
?php // Create an Imagick object $imagick = new Imagick( // Use orderedPosterizeImage function $imagick->orderedPosterizeImage('o8x8, 3, 3'); // Set image format $imagick->setImageFormat('png'); header("Content-Type: image/png"); // Display the output image echo $imagick->getImageBlob(); ?> |
Output:

Reference: http://php.net/manual/en/imagick.orderedposterizeimage.php
Recommended Posts:
- PHP | Imagick getImageGamma() Function
- PHP | Imagick flipImage() Function
- PHP | Imagick getImageColorspace() Function
- PHP | Imagick shadeImage() Function
- PHP | Imagick vignetteImage() Function
- PHP | Imagick getImageColors() Function
- PHP | Imagick brightnessContrastImage() Function
- PHP | Imagick getImageSignature() Function
- PHP | Imagick getInterlaceScheme() Function
- PHP | Imagick getImageTicksPerSecond() Function
- PHP | Imagick opaquePaintImage() Function
- PHP | Imagick randomThresholdImage() Function
- PHP | Imagick radialBlurImage() Function
- PHP | Imagick rollImage() Function
- PHP | Imagick identifyImage() 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.



