views:

53

answers:

2

I have to suppose I'm given a picture, there shouldnt be any user inputs or calls to media.chose file, so given a picture return the average red value of all the Pixels in that Picture (as an int). If the average calculation results in a non-integer value, then truncate the result. For example, if you average the values 10, 6 and 4, the result would be 6.

A: 

Python Imaging Library

Ignacio Vazquez-Abrams
+1  A: 

The question is almost answered here

Use PIL to load the image, read it pixel by pixel and do your calculation.

pyfunc