Skip to content

Instantly share code, notes, and snippets.

@juananpe
Created July 30, 2018 19:42
Show Gist options
  • Save juananpe/138d4a5748f9d7e031ccdbaaac30979f to your computer and use it in GitHub Desktop.
Save juananpe/138d4a5748f9d7e031ccdbaaac30979f to your computer and use it in GitHub Desktop.
Mostrar una imagen en b&n a partir de un archivo de 1's y 0s
from PIL import Image
with open('payload.bin','rb') as textfile:
bytestring = textfile.read()
image_data = bytestring # byte values of the image
image = Image.frombytes('1', (16*8,366), image_data, 'raw')
image = image.transpose(Image.TRANSPOSE)
image.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment