return -ent * log2(1 / ent)
im = Image.open('test.png')
h = im.histogram()
print(get_histogram_dispersion(h))
How to identify non-photograph or 'uninteresting' images using Python Imaging Library (PIL)