I am looking at a problem, where I want to know how many colors a scientific chart contains. For example, consider the image
. While there are four (red, green, blue and black) visually distinguishable colors here, according to the pixels, there are more than 1000 colors. What would be some ways I can tackle this problem?