private static function getHisto($pixels)
{
$histo = array();
foreach ($pixels as $rgb) {
list($red, $green, $blue) = static::getColorsFromIndex($rgb);
$index = static::getColorIndex($red, $green, $blue);
$histo[$index] = (isset($histo[$index]) ? $histo[$index] : 0) + 1;
}
return $histo;
}