Revert "rembg b - return a stream of RGB24 instead of a mess of consecutive pngs"

This commit is contained in:
calledit 2025-01-30 13:54:16 +01:00 committed by GitHub
parent 1f98d03b95
commit b9634aaf7e
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()