From 4ba52b3695469ba773bfce03c19fe3c8b442b8fd Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Sat, 10 Feb 2024 20:16:38 +0100 Subject: Update image.py --- g4f/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'g4f') diff --git a/g4f/image.py b/g4f/image.py index 29194d6e..31c3d577 100644 --- a/g4f/image.py +++ b/g4f/image.py @@ -163,10 +163,10 @@ def process_image(img: Image, new_width: int, new_height: int) -> Image: # Resize image img.thumbnail((new_width, new_height)) # Remove transparency - if img.mode != "RGB": + if img.mode == "RGBA": img.load() white = new_image('RGB', img.size, (255, 255, 255)) - white.paste(img, mask=img.convert('RGBA').split()[-1]) + white.paste(img, mask=img.split()[-1]) return white return img -- cgit v1.2.3