added blue and red calculator

This commit is contained in:
Technoduck 2024-11-19 12:35:29 -05:00
parent c035ec05da
commit b62b4b921c

17
app.py
View file

@ -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):