File:Shadowrealm.jpg
Licensing
gollark: What?
gollark: ***gaaah***
gollark: Make sure that the first function yields enough.
gollark: It... shouldn't.
gollark: ```python#!/usr/bin/env python3from PIL import Imageimport mathimport sysdef chunks(l, n): for i in range(0, len(l), n): yield l[i:i + n]def from_bit_list(bl): i = 0 for ix, v in enumerate(bl): i |= v * (2 ** (7 - ix)) return iim = Image.open("out.png")id = im.load()(w, h) = im.sizebits = []for x in range(w): for y in range(h): bits.append(id[x, y])bits = [1 if x >= 1 else 0 for x in bits]byts = [from_bit_list(bytegroup) for bytegroup in chunks(bits, 8)]sys.stdout.buffer.write(bytes(byts))```Here it is. It's really rather awful.
This article is issued from Dandwiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.