GoLang ImagickPixel::getColorCount

request it (212)
GoLang replacement for PHP's ImagickPixel::getColorCount [edit | history]

Do you know a GoLang replacement for PHP's ImagickPixel::getColorCount? Write it!

PHP ImagickPixel::getColorCount

PHP original manual for ImagickPixel::getColorCount [ show | php.net ]


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

Return Values

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


Example #1 ImagickPixel getColorCount()

= new \Imagick();
$histogramElements $imagick->getImageHistogram();
$lastColor array_pop($histogramElements);
"Last pixel color count is: ".$lastColor->getColorCount();

The output for this will be similar to:

Last pixel color count is: 256244