This commit is contained in:
glmdev
2019-02-09 15:33:44 -06:00
parent 31c6293576
commit 2ffafa6719
10 changed files with 68 additions and 55 deletions

View File

@@ -1,8 +1,9 @@
def average_color(x, y, n, image):
def average_color(x, y, w, h, image):
r, g, b = 0, 0, 0
count = 0
for s in range(x, x + n + 1):
for t in range(y, y + n + 1):
print([x, y, w, h])
for s in range(x, x + w + 1):
for t in range(y, y + h + 1):
pixlr, pixlg, pixlb = image[s, t]
r += pixlr
g += pixlg