mirror of
https://git.mirrors.martin98.com/https://github.com/danielgatis/rembg
synced 2025-08-15 09:45:57 +08:00
Return a stream of RGB24 instead of a garbled mess of consecutive pngs
This commit is contained in:
parent
37bbf63500
commit
dbf1c17610
@ -135,9 +135,7 @@ def b_command(
|
||||
os.makedirs(output_dir, exist_ok=True)
|
||||
|
||||
def img_to_byte_array(img: PILImage) -> bytes:
|
||||
buff = io.BytesIO()
|
||||
img.save(buff, format="PNG")
|
||||
return buff.getvalue()
|
||||
return img.convert('RGB').tobytes("raw", "RGB")
|
||||
|
||||
async def connect_stdin_stdout():
|
||||
loop = asyncio.get_event_loop()
|
||||
|
Loading…
x
Reference in New Issue
Block a user