I have a program that extracts the colors used in an image. The image is created by me using MSPaint (please take a look at the attached picture). I believe that the program should show atmost 7 unique colors. But i get many results. The code is given below:
You'll probably find that the extra colors occur around the circles perimeters. Most drawing programs don't just paint a single line of black pixels, they add interpolated pixels to the left and right of the line in order to create a smooth appearance.
So there'll probably be lots of colors that are halfway between black and whatever color happens to occur on one side of the line. I'm sure high-end drawing apps have a way of preventing this; not sure about Paint, though.