Instantly share code, notes, and snippets.

@juananpe /visualizar.py Secret
Created Jul 30, 2018

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