Search code examples
pythonimagepixelbitraspberry-pi2

How to get a 8, 8-bit integer list from a Image?


I'm coding a little on my RasperryPi and Display-O-Tron 3000 with its python framework.

Can anyone explain how can i get a list with 8x 8-bit values from an image, please?

List looks like:

for pacman:

pacman = [
    [0x0e, 0x1f, 0x1d, 0x1f, 0x18, 0x1f, 0x1f, 0x0e],
    [0x0e, 0x1d, 0x1e, 0x1c, 0x18, 0x1c, 0x1e, 0x0f]
]

or a down arrow:

arr = [
    [31, 14, 4, 0, 0, 0, 0, 0],
    [0, 31, 14, 4, 0, 0, 0, 0],
    [0, 0, 31, 14, 4, 0, 0, 0],
    [0, 0, 0, 31, 14, 4, 0, 0],
    [0, 0, 0, 0, 31, 14, 4, 0],
    [0, 0, 0, 0, 0, 31, 14, 4],
    [4, 0, 0, 0, 0, 0, 31, 14],
    [14, 4, 0, 0, 0, 0, 0, 31]
]

I'm trying to get lists like these from an image.


Solution

  • this great Online-tool solved my problem

    http://blog.riyas.org/2013/12/online-led-matrix-font-generator-with.html

    Cheers Chris