repl.it
@pizzafox/

gamejam-secret-solution

Python

No description

fork
loading
Files
  • main.py
  • done.png
  • out.png
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from PIL import Image

public = Image.open("out.png").convert("RGB")

done = Image.new("RGB", (600, 600))

mask = 1 # 00000001 in binary
shift_amt = 7

for x in range(600):
  for y in range(600):
    public_pix = public.getpixel((x, y))

    final = (
      (public_pix[0] & mask) << shift_amt,
      (public_pix[1] & mask) << shift_amt,
      (public_pix[2] & mask) << shift_amt
    )

    done.putpixel((x, y), final)

done.save('done.png')