Any idea how i can determine a discreet list of colors that are used in a bitmap. For example, if a bitmap contained a primitive American Flag, the method would return Color.Red, Color.White, Color.Blue. I intend to have the return values sorted by usage within the bitmap. So the return would be red, white then blue.
I want to write a method in C# which has the following signature?
public static Color GetColorsFromBitmap(Bitmap bitmap)
// What goes here? How do i loop through the pixels (assuming i have to)?