From 7b4397f66ca09816184ce69d5a2be0bb1928b3bf Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 16 Jun 2024 20:51:14 +0100 Subject: [PATCH] Remove clutter --- src/editor/operations/add_noise.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/editor/operations/add_noise.py b/src/editor/operations/add_noise.py index db6e40f..8894f93 100644 --- a/src/editor/operations/add_noise.py +++ b/src/editor/operations/add_noise.py @@ -3,9 +3,8 @@ from PIL import Image def add_noise(img: Image, alpha: float) -> Image: - img = img.convert("RGB") width, height = img.size random_colors = np.random.randint(0, 256, (height, width, 3), dtype=np.uint8) - random_img = Image.fromarray(random_colors, mode="RGB") + random_img = Image.fromarray(random_colors) result = Image.blend(img, random_img, alpha) return result