mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-12-24 11:34:02 +03:00
Fix process_image to handle transparency correctly
This commit is contained in:
parent
2250e37fec
commit
b2f1c73019
@ -166,7 +166,7 @@ def process_image(img: Image, new_width: int, new_height: int) -> Image:
|
|||||||
if img.mode != "RGB":
|
if img.mode != "RGB":
|
||||||
img.load()
|
img.load()
|
||||||
white = new_image('RGB', img.size, (255, 255, 255))
|
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 white
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user