daschr/pico-ssd1306

bitmaps are sometimes inverted

Closed this issue · 3 comments

I tried rendering bitmaps, but in some cases the result was inverted.
Here is an example containing the source monochrome bitmap and the generated header file: example.zip

Currently, the library will draw all black pixels (see https://github.com/daschr/pico-ssd1306/blob/main/example/test.bmp).
Your keyboard example uses black as the background color and white as the foreground.
You may negate the bmp before embedding it (f.e using imagemagick and convert keyboard_24_16.bmp -negate keyboard_24_16_negated.bmp).

One could also add an option to draw the image negative.

There is code in the bin2c tool that handles foreground and backgroud colors but somehow it does not work for my image, so I guess that is a bug in bin2c

ah okay, I did not understand you correctly, because my head was stuck in thinking that the white pixels are the illuminated pixels - I can work with that, thanks