Merge pull request #719 from calledit/revert-718-patch-1

Revert "rembg b - return a stream of RGB24 instead of a mess of consecutive pngs"
This commit is contained in:
Daniel Gatis 2025-01-30 11:29:03 -03:00 committed by GitHub
commit a34d440fca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -135,7 +135,9 @@ def b_command(
os.makedirs(output_dir, exist_ok=True)
def img_to_byte_array(img: PILImage) -> bytes:
return img.convert('RGB').tobytes("raw", "RGB")
buff = io.BytesIO()
img.save(buff, format="PNG")
return buff.getvalue()
async def connect_stdin_stdout():
loop = asyncio.get_event_loop()