rivers retmor
rivers retmor

Reputation: 1

Help editing a picture in python

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.

Upvotes: 0

Views: 1940

Answers (2)

pyfunc
pyfunc

Reputation: 66709

The question is almost answered here

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

Upvotes: 1

Related Questions