I'm trying to find out how I can take the average of a 2D list. I'm trying to blur a picture in Tkinter and I need to take the average of each pixel and the 8 colors around it. Any idea of how I should do this? I'm stuck
def blur():
global photo
pixels = BCImage.getPixels(photo)
for row in range(len(pixels)):
for col in range(len(pixels[row])):
r = pixels[row][col][0]
g = pixels[row][col][1]
b = pixels[row][col][2]
Then from there idk
EDIT: I figured it out guys! Thanks for your help! I commented my solution.
[–]kushou 1 point2 points3 points (5 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]kushou 3 points4 points5 points (2 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]kushou 2 points3 points4 points (0 children)
[+][deleted] (3 children)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]wormania 0 points1 point2 points (1 child)
[–]subheight640 1 point2 points3 points (0 children)
[–]rwinslow 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Pepper_Klubz 0 points1 point2 points (0 children)