diff --git a/app.py b/app.py index cbc3752..91fbb5e 100644 --- a/app.py +++ b/app.py @@ -247,11 +247,20 @@ class renderedImageZoom: def get_image_average(self,color,low, high): if color == "blue": slice = self.image[:][low:high] - print(slice.size) - print(slice) - return "{} + {}".format(low,high) + blue = 0 + for line in slice: + blue += sum([p[2]/(p[0]+p[1]+p[2]) for p in line]) + + blue = blue / (100*(high-low)) + return "{} is the pixel average".format(blue) else: - return "red".format(low,high) + slice = self.image[:][low:high] + red = 0 + for line in slice: + red += sum([p[0]/(p[0]+p[1]+p[2]) for p in line]) + + red = red / (100*(high-low)) + return "{} is the pixel average".format(red) def env_setter(self,environment_constant,g):