ImagickPixel::getColorCount

(PECL imagick 2.0.0)

ImagickPixel::getColorCountReturns the color count associated with this color

설명

int ImagickPixel::getColorCount ( void )

Returns the color count associated with this color.

The color count is the number of pixels in the image that have the same color as this ImagickPixel.

ImagickPixel::getColorCount appears to only work for ImagickPixel objects created through Imagick::getImageHistogram()

반환값

Returns the color count as an integer on success, throws ImagickPixelException on failure.

예제

Example #1 ImagickPixel getColorCount()

<?php
    $imagick 
= new \Imagick();
    
$imagick->newPseudoImage(640480"magick:logo");
    
$histogramElements $imagick->getImageHistogram();
    
$lastColor array_pop($histogramElements);
    echo 
"Last pixel color count is: ".$lastColor->getColorCount();
?>

The output for this will be similar to:

Last pixel color count is: 256244

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top