Skip to content

Instantly share code, notes, and snippets.

@Moulberry
Created December 6, 2021 06:38
Show Gist options
  • Save Moulberry/12e4807d8233886b98c02c7dfaefe157 to your computer and use it in GitHub Desktop.
Save Moulberry/12e4807d8233886b98c02c7dfaefe157 to your computer and use it in GitHub Desktop.
LCCH Generator
#!/bin/python3
from PIL import Image
import math, base64
i = Image.open("lcch.png")
pixels = i.load()
width, height = i.size
bytes = [0] * math.ceil(width*height/8)
for y in range(height):
for x in range(width):
pixel = pixels[x, y]
if pixel[3] > 200:
index = x + y*width
bIndex = index//8
bit = 1 << (index%8)
bytes[bIndex] |= bit
print("LCCH-37-"+base64.encodebytes(bytearray(bytes)).decode('utf-8').replace('=', '').replace('\n', ''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment