Hi, Im currently taking an introductory course in python and i need help with some stuff.
Basically for an assignment the first function we have is supposed to get an an average red value of all the pixels in the image. red being the R in (RGB). So basically the red pigment value. So basically i need to find the R value for all the pixels in the image and then add them up and divide by the total number of pixels. Now we are using the pygraphics module for this so this is what i have so far.
import media
def red_average():
pic = media.load_picture(media.choose_file())
for p in media.get_pixels(pic):
x = (sum(range(media.get_red(p))))
print x
Now instead of giving me 1 big number it gives me a list of numbers instead when i call the function. Basically does that mean its adding up all the red values from each row of pixels and displaying them?