Skip to content

Instantly share code, notes, and snippets.

@acadien
Last active August 29, 2015 13:57
Show Gist options
  • Save acadien/9400532 to your computer and use it in GitHub Desktop.
Save acadien/9400532 to your computer and use it in GitHub Desktop.
import matplotlib as mpl
import pylab as pl
def colorHist(pngFile):
a = pl.imread(pngFile)
b = mpl.colors.rgb_to_hsv(a[...,:3])[...,1].flatten()
vals,bins,dummy = pl.hist(b,256,visible=False)
#chop off the first bin because its white
pl.plot(bins[1:],vals[1:])
pl.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment