ws2812 led matrix / convert lowres black/white bitmap into array for python

Im quite new here and upon that I dont even own an arduino but a raspberryPI !:slight_smile:

BUT my problem is quite basic,so the answer might be useful for an arduino user as well!
I have a ws2812b led matrix (32x18=576) ,the alignment is snake/serpentine like,and I would like to find a way to show simple bitmap graphics (black&white == led on/off with defined color).But no animation ,just a static icon for notification stuff.
So Im looking for a way to convert a black&white 32x18 pixel bitmap into an array like :
icon=[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0...]

and to use above with the python/neopixelcode like : strip.setPixelColor(led, Color(r, g, b))
(if 0,led stays off/if 1,its painted with the given r,g,b color)

that way I can show an icon with my current script without any changes/or importing additional stuff.
Current project can be checked out@ 2020_data/traffic_VISUALIZATION #3(32*18/576) – ralph´s raspberryPI & LED & otherCOOLstuff blog
its a traffic visualization display,but I would like to expand its features for i..e showing motionalert (outside) ,or doorbell notifcations,incoming email/...
any help is highly appreciated !!

As you are using a Raspberry this question should be asked on a Forum that deal with Python because there is no need, on an RPI, to use C++ code which might be useful for an Arduino.

The Python PIL library has a lot of capability for managing image files.


its not a python nor a raspberryPI question.(also I dont want to use pil,as I want to integrate the display of an icon into my current script)

so its just to find the basic way of converting (doesnt have to happen in python,maybe just a simple formula,or otherway) a black/white bitmap into an array following the way of the leds (snakelike) on the matrix.

its not a python nor a raspberryPI question.

Convince us that it is an Arduino question !