summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-02-10 17:19:19 +0100
committerGitHub <noreply@github.com>2024-02-10 17:19:19 +0100
commitebcfa97c81f3764794e9411f3ec3d9bb7641e21a (patch)
tree0d10495653fc3eed2dc9a7665f26a28f5982a2ff
parent. (diff)
parentFix process_image to handle transparency correctly (diff)
downloadgpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar.gz
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar.bz2
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar.lz
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar.xz
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.tar.zst
gpt4free-ebcfa97c81f3764794e9411f3ec3d9bb7641e21a.zip
-rw-r--r--g4f/image.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/g4f/image.py b/g4f/image.py
index f0ee0395..29194d6e 100644
--- a/g4f/image.py
+++ b/g4f/image.py
@@ -166,7 +166,7 @@ def process_image(img: Image, new_width: int, new_height: int) -> Image:
if img.mode != "RGB":
img.load()
white = new_image('RGB', img.size, (255, 255, 255))
- white.paste(img, mask=img.split()[3])
+ white.paste(img, mask=img.convert('RGBA').split()[-1])
return white
return img