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. Available since 6.3.1

From the ImageMagick manual for MagickOrderedPosterizeImage: A string containing the name of the threshold dither map to use, followed by zero or more numbers representing the number of color levels tho dither between.

For example: "o3x3,6" generates a 6 level posterization of the image with a ordered 3x3 diffused pixel dither being applied between each level. While checker,8,8,4 will produce a 332 colormaped image with only a single checkerboard hash pattern (50 grey) between each color level, to basically double the number of color levels with a bare minimim of dithering.
¯\_(ツ)_/¯

The predefined posterization types available are defined in the ImageMagick file: config/thresholds.xml
Touch/mouse over to see original View modified in new window.
Image
Posterize type
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. Available since 6.3.1

From the ImageMagick manual for MagickOrderedPosterizeImage: A string containing the name of the threshold dither map to use, followed by zero or more numbers representing the number of color levels tho dither between.

For example: "o3x3,6" generates a 6 level posterization of the image with a ordered 3x3 diffused pixel dither being applied between each level. While checker,8,8,4 will produce a 332 colormaped image with only a single checkerboard hash pattern (50 grey) between each color level, to basically double the number of color levels with a bare minimim of dithering.
¯\_(ツ)_/¯

The predefined posterization types available are defined in the ImageMagick file: config/thresholds.xml
Parameters
threshold_mapstringA string containing the name of the threshold dither map to use
channelintProvide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channeltype constants using bitwise operators. Refer to this list of channel constants.
function orderedPosterizeImage($imagePath, $orderedPosterizeType)
{
    $imagick = new \Imagick(realpath($imagePath));
    $imagick->orderedPosterizeImage($orderedPosterizeType);
    $imagick->setImageFormat('png');
    
    header("Content-Type: image/png");
    echo $imagick->getImageBlob();
}