Skip to content

Commit

Permalink
Revert "rembg b - return a stream of RGB24 instead of a mess of conse…
Browse files Browse the repository at this point in the history
…cutive pngs"
  • Loading branch information
calledit authored Jan 30, 2025
1 parent 1f98d03 commit b9634aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rembg/commands/b_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b9634aa

Please sign in to comment.