Question

I am generating color pallete for image through octree quantization. Its gives me maximum 256 colors for any image. Now i want to show only top 10 ( according to the quantity of color in image ) colors of the image out of these 256 colors. How can i do this in c#?

Was it helpful?

Solution

Create a histogram, that is, count the number of pixels mapped to each color in the picture, then sort it in descending order and take the 10 first elements of the sorted array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top