diff --git a/projet/codes/Image_Recursive.py b/projet/codes/Image_Recursive.py index bf5db5796d5db53f07df70d137cfb0b85f6a81c7..ffa978e2f81d8b9173ce391a9024ea13c076ce12 100644 --- a/projet/codes/Image_Recursive.py +++ b/projet/codes/Image_Recursive.py @@ -22,7 +22,11 @@ def Image_Recursive(image: Image, order: int): if order != 0: allblocks = b.divide_blocks() allb = [Image_Recursive(b1.image, order -1) for b1 in allblocks] - if all(b1.is_uniform) + if all(b1.is_uniform() for b1 in allb): + avg_c = average_color([b1.color for b1 in allb]) + new_b = Block(Image.new(image.size, avg_c)) + return new_b + else: block_im = Image.new(image.size)