User:Cristinac/Project01: Difference between revisions
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
</source> | </source> | ||
[[ffmpeg]] |
Revision as of 16:36, 17 February 2015
Python script:
from PIL import Image
def avg(p):
pil_im = Image.open(p)
i=pil_im.convert('L')
i.thumbnail((1,1))
g=i.getpixel((0,0))
return g
from glob import glob
imgs = glob("*.jpeg")
imgs.sort()
d = []
for x in imgs:
d.append((avg(x), x))
d.sort()
print d