GoLang Imagick::posterizeImage

request it (320)
GoLang replacement for PHP's Imagick::posterizeImage [edit | history]



Do you know a GoLang replacement for PHP's Imagick::posterizeImage? Write it!

PHP Imagick::posterizeImage

PHP original manual for Imagick::posterizeImage [ show | php.net ]

Imagick::posterizeImage

(PECL imagick 2.0.0)

Imagick::posterizeImageReduces the image to a limited number of color level

Description

bool Imagick::posterizeImage ( int $levels , bool $dither )

Reduces the image to a limited number of color level.

Parameters

levels

dither

Return Values

Returns TRUE on success.

Examples

Example #1 Imagick::posterizeImage()

<?php
function posterizeImage($imagePath$posterizeType$numberLevels) {
    
$imagick = new \Imagick(realpath($imagePath));
    
$imagick->posterizeImage($numberLevels$posterizeType);
    
$imagick->setImageFormat('png');
    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

posterizeImage($imagePath, \Imagick::DITHERMETHOD_RIEMERSMA8);

?>