Added missing random things
Mostly sample images and tiny scripts for weight calculation. Nothing too of importance
After Width: | Height: | Size: 66 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 131 B |
After Width: | Height: | Size: 2.8 KiB |
|
@ -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])
|
||||
])))
|