Skip to content

Instantly share code, notes, and snippets.

@juananpe
Created July 30, 2018 19:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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