From 0aeb56763f311202c25c89837ac7ed6ad8068afc Mon Sep 17 00:00:00 2001
From: Kinadinova Dariya <dariya.kinadinova.etu@115p4.fil.univ-lille.fr>
Date: Wed, 27 Mar 2024 14:16:42 +0100
Subject: [PATCH] Image_Recursive

---
 projet/codes/Image_Recursive.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/projet/codes/Image_Recursive.py b/projet/codes/Image_Recursive.py
index bf5db57..ffa978e 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)
         
 
 
-- 
GitLab