Detection of most frequent colors in images