From c9751539eb1b86ec645e1f8c10cd5446aa0d3c2e Mon Sep 17 00:00:00 2001 From: Kinadinova Dariya <dariya.kinadinova.etu@115p4.fil.univ-lille.fr> Date: Wed, 27 Mar 2024 13:48:19 +0100 Subject: [PATCH] class block --- projet/{ => codes}/Block.py | 3 +-- projet/{ => codes}/Decouper_Image.py | 3 +-- projet/{ => codes}/color.py | 0 projet/{ => codes}/ex.py | 0 4 files changed, 2 insertions(+), 4 deletions(-) rename projet/{ => codes}/Block.py (97%) rename projet/{ => codes}/Decouper_Image.py (89%) rename projet/{ => codes}/color.py (100%) rename projet/{ => codes}/ex.py (100%) diff --git a/projet/Block.py b/projet/codes/Block.py similarity index 97% rename from projet/Block.py rename to projet/codes/Block.py index 4c84600..654b5bb 100644 --- a/projet/Block.py +++ b/projet/codes/Block.py @@ -5,7 +5,7 @@ """ from PIL import Image, ImageDraw -from color.py import * +from color import * class Block: def __init__(self, image): @@ -30,7 +30,6 @@ class Block: colors = liste_col(self.image, (0, 0), (self.width-1, self.height-1)) return avg_col(colors) - def is_uniform(self, coordinates: tuple()): """à_remplacer_par_ce_que_fait_la_fonction diff --git a/projet/Decouper_Image.py b/projet/codes/Decouper_Image.py similarity index 89% rename from projet/Decouper_Image.py rename to projet/codes/Decouper_Image.py index 5310319..d2b834b 100644 --- a/projet/Decouper_Image.py +++ b/projet/codes/Decouper_Image.py @@ -1,7 +1,7 @@ from PIL import Image, ImageDraw -def decouper(file: str) -> list[Image]: +def decouper(im: Image) -> list[Image]: """splits image into four blocks Précondition : @@ -9,7 +9,6 @@ def decouper(file: str) -> list[Image]: $$$ """ - im = Image.open(file) im_rgb = im.convert('RGB') size = im_rgb.size w = size[0] diff --git a/projet/color.py b/projet/codes/color.py similarity index 100% rename from projet/color.py rename to projet/codes/color.py diff --git a/projet/ex.py b/projet/codes/ex.py similarity index 100% rename from projet/ex.py rename to projet/codes/ex.py -- GitLab