Created
December 6, 2021 06:38
-
-
Save Moulberry/12e4807d8233886b98c02c7dfaefe157 to your computer and use it in GitHub Desktop.
LCCH Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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