pico-ssd1306 icon indicating copy to clipboard operation
pico-ssd1306 copied to clipboard

bitmaps are sometimes inverted

Open AberDerBart opened this issue 1 year ago • 2 comments
trafficstars

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

AberDerBart avatar Feb 24 '24 09:02 AberDerBart

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.

daschr avatar May 17 '24 08:05 daschr

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

AberDerBart avatar May 21 '24 06:05 AberDerBart

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

AberDerBart avatar Sep 03 '24 21:09 AberDerBart