update : 2015.11.03
php.shukuma.com

검색:
 
 
Reduces the image to a limited number of color level

Imagick::posterizeImage

(PECL imagick 2.0.0)

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

설명

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

Reduces the image to a limited number of color level.

인수

levels

dither

반환값

성공시에 TRUE를 반환합니다.

예제

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);

?>