Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitmaps are sometimes inverted #19

Open
AberDerBart opened this issue Feb 24, 2024 · 2 comments
Open

bitmaps are sometimes inverted #19

AberDerBart opened this issue Feb 24, 2024 · 2 comments

Comments

@AberDerBart
Copy link

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

@daschr
Copy link
Owner

daschr commented May 17, 2024

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.

@AberDerBart
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants