diff --git a/Day 8/decode.py b/Day 8/decode.py index aaa8b81..929c47d 100755 --- a/Day 8/decode.py +++ b/Day 8/decode.py @@ -74,7 +74,7 @@ if snail.count("0") != bits.count("0") or snail.count("1") != bits.count("1"): print("Bits do not match") exit() -im = Image.new('RGB', im.size) +im = Image.new('RGB', im.black) pix = im.load() for tileY in range(0, numTiles): diff --git a/Day 9/decode.py b/Day 9/decode.py new file mode 100755 index 0000000..2abfb7b --- /dev/null +++ b/Day 9/decode.py @@ -0,0 +1,38 @@ +#!/usr/bin/python + +from PIL import Image + +imageOriginal = Image.open("medium_64_original.png") +imageFake = Image.open("medium-64_decompressed.png") + +pixOriginal = imageOriginal.load() +pixFake = imageFake.load() + +if imageOriginal.size != imageFake.size: + print("Images differ in Size") + exit() + +diffs = [] + +Size = imageOriginal.size +for y in range(Size[0]): + for x in range(Size[1]): + if pixOriginal[x,y] != pixFake[x,y]: + diffs.append([x,y]) + +x0 = min([diff[0] for diff in diffs]) +x1 = max([diff[0] for diff in diffs]) +y0 = min([diff[1] for diff in diffs]) +y1 = max([diff[1] for diff in diffs]) + +imageNew = Image.new('RGB', Size, "white") +pix = imageNew.load() + +for x in range(x0, x1+1): + for y in range(y0, y1+1): + pix[x,y] = (0,0,0,255) + +for diff in diffs: + pix[diff[0], diff[1]] = (255,255,255,255) + +imageNew.save("decoded.png") diff --git a/Day 9/decoded.png b/Day 9/decoded.png new file mode 100644 index 0000000..d38a27e Binary files /dev/null and b/Day 9/decoded.png differ diff --git a/Day 9/medium-64.png b/Day 9/medium-64.png new file mode 100644 index 0000000..f48a12d Binary files /dev/null and b/Day 9/medium-64.png differ diff --git a/Day 9/medium-64_decompressed.png b/Day 9/medium-64_decompressed.png new file mode 100644 index 0000000..1c4adaf Binary files /dev/null and b/Day 9/medium-64_decompressed.png differ diff --git a/Day 9/medium_64_original.png b/Day 9/medium_64_original.png new file mode 100644 index 0000000..2b01012 Binary files /dev/null and b/Day 9/medium_64_original.png differ diff --git a/Teaser/_ZOoxjUSe1OVB7OPoVrsX.pdf.extracted/break_santa.py b/Teaser/_ZOoxjUSe1OVB7OPoVrsX.pdf.extracted/break_santa.py new file mode 100644 index 0000000..013e4b7 --- /dev/null +++ b/Teaser/_ZOoxjUSe1OVB7OPoVrsX.pdf.extracted/break_santa.py @@ -0,0 +1 @@ +#!/usr/bin/python