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#?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top