diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-02-10 17:19:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 17:19:19 +0100 |
commit | ebcfa97c81f3764794e9411f3ec3d9bb7641e21a (patch) | |
tree | 0d10495653fc3eed2dc9a7665f26a28f5982a2ff | |
parent | . (diff) | |
parent | Fix process_image to handle transparency correctly (diff) | |
download | gpt4free-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.py | 2 |
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 |