I have a jpeg image and want to plot a histogram of how frequently each color occurs in the image. I am able to generate a frequency table using pymorph.histogram(), but I don't know the actual color that each of the 256 colors indices correspond to. How can I generate this palette?
Further, is there an way to just generate a histogram plot of all these numbers, with the colors indicated (not a number in the range 0-255, but the actual color displayed)?
My frequency list is generated using this code:
import pymorph
import Image
im=Image.open('image.jpg')
im=np.asarray(im)
hist_im=pymorph.histogram(im)