evilOLED icon indicating copy to clipboard operation
evilOLED copied to clipboard

Problem converting image.

Open WanderLG opened this issue 6 years ago • 0 comments

Hello, how are you?

By converting your font.gif with converter.py I am not getting the same result as you did. Look:

const int bmap [8] = { B0, B0, B1, B1, B1, B0, B0, B0, B0, B1, B0, B0, B0, B1, B0, B0, B1, B0, B0, B0, B1, B0, B1, B0, B1, B0, B0, B1, B0, B0, B1, B0, B1, B0, B1, B0, B0, B0, B1, B0, B0, B1, B0, B0, B0, B1, B0, B0, B0, B0, B1, B1, B1, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B1, B0, B1, B1, B1, B1, B1, B1, B1, B0, B0, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B1, B0, B0, B0, B0, B0, B0, B0, B0, B0, B0, ... ... ... }

But I don't understand anything about python and I don't know how to fix the problem. Can you help me? I am using your script.


import sys import numpy from PIL import Image

im = Image.open(sys.argv[1]) im = im.convert("1") rows = (im.size[1] // 8) cols = im.size[0] val = ""

print("const int bmap[8]= {")

for p in range(rows): for xx in range(cols): for yy in range(8): pix = im.getpixel((xx,(p * 8) + yy)) if (pix == 0): val = "1" + val else: val = "0" + val val = "B" + val print(val + ",", end='') val = "" if (xx % 8 == 7): print("")

print("}")

Thanks. and congratulations. You have greatly reduced the use of atmega328p with your library.

WanderLG avatar Sep 19 '19 14:09 WanderLG