diff --git a/cpi-images/casey.png b/cpi-images/casey.png new file mode 100644 index 0000000..9ea7fe0 Binary files /dev/null and b/cpi-images/casey.png differ diff --git a/cpi-images/cute.png b/cpi-images/cute.png new file mode 100644 index 0000000..0d46e4a Binary files /dev/null and b/cpi-images/cute.png differ diff --git a/cpi-images/n25.png b/cpi-images/n25.png new file mode 100644 index 0000000..5b000d9 Binary files /dev/null and b/cpi-images/n25.png differ diff --git a/cpi-images/rando.png b/cpi-images/rando.png new file mode 100644 index 0000000..afb52d5 Binary files /dev/null and b/cpi-images/rando.png differ diff --git a/cpi-images/rat.png b/cpi-images/rat.png new file mode 100644 index 0000000..5bf6740 Binary files /dev/null and b/cpi-images/rat.png differ diff --git a/cpi-images/wp.cpi b/cpi-images/wp.cpi new file mode 100644 index 0000000..a064de5 Binary files /dev/null and b/cpi-images/wp.cpi differ diff --git a/mess/avg.png b/mess/avg.png new file mode 100644 index 0000000..63d62a8 Binary files /dev/null and b/mess/avg.png differ diff --git a/mess/cc_font.png b/mess/cc_font.png new file mode 100644 index 0000000..0b2052b Binary files /dev/null and b/mess/cc_font.png differ diff --git a/mess/gen-weights.py b/mess/gen-weights.py new file mode 100644 index 0000000..05bafd2 --- /dev/null +++ b/mess/gen-weights.py @@ -0,0 +1,25 @@ +from PIL import Image +from collections import Counter + +with Image.open("./cc_font.png") as im: + pixels = im.load() + weights = [0 for _ in range(6 * 9)] + for char in range(256): + ctx, cty = (char % 16) * 8, (char // 16) * 11 + for oy in range(9): + for ox in range(6): + pix = int(pixels[ctx + ox + 1, cty + oy + 1][0]) # type: ignore + weights[ox + 6 * oy] += 1 if pix else 0 + + with Image.new("L", (6, 9), 0) as im_out: + for y in range(9): + for x in range(6): + print("%3d" % weights[x + 6 * y], end="\t") + im_out.putpixel((x, y), weights[x + 6 * y]) + print() + + im_out.save("avg.png") + + print(dict(enumerate([ + iv[0] for iv in sorted(enumerate(weights), key=lambda iv: iv[1]) + ])))