def detect_edges (image: Image, threshold: float) -> Image:
new_image = copy(image) for x,y, (r,g,b) in image: brightness = (r+g+b)/3 if abs