summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g4f/image.py4
1 files changed, 2 insertions, 2 deletions
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