jack wrote: > As you're using normal write() calls to sys.stdout you'll be messing up > your \r and \n bytes in the image: sys.stdout is a text-mode file so > you can't write binary data to it. At least: not on Windows. on Windows, the "-u" option sets the output to binary mode: C:/> python -? ... -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x) ... </F>