I was thinking about those maid card things from the maid poster. I actually sort of like the idea, but I hate Java. So I made this simple Python version. It only packs and unpacks and takes just card.png and turns it into image.png and code.py or the reverse. Does it work with image upload shit?
#!/usr/bin/env python3
import sys
import os
from PIL import Image
bit_on, bit_off = (0, 0, 0, 255), (255, 255, 255, 255)
bits_from_nibble = lambda n: [bit_on if n >> k & 1 else bit_off for k in (3, 2, 1, 0)]
nibble_from_pixels = lambda pixels: sum(
((sum(px[:3]) < 384) << k) for px, k in zip(pixels, (3, 2, 1, 0))
)
def unpack():
card = Image.open("card.png").convert("RGBA")
Comment too long. Click here to view the full text.