Yes, this can be done. For simple uses, a simple python program is sufficient. Using the imaging library:
from PIL import Image im = Image.open("image.png") data = im.getdata()
You can now access color data for each pixel of the image in the data
variable. For more complex needs, there is a lot more that can be done. For example, see a blog post on finding dominant colors in images.