-
Notifications
You must be signed in to change notification settings - Fork 48
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
An example code of displaying an bitmap image using micropython does not exist. #18
Comments
There several ways to go about this, at least in C, which some probably can be ported to MP. You can convert images into a hex array as a .h or .c file and call those by name. The good thing about these is since you are reading from compiled files you don't lose your RAM space which depending on the size of the screen and if it has colors, you can run out of space in the frame buffer, especially in MP because you have to load the MP u2f firmware which eats some of the precious memory. I usually do the above but again that's for C/C++. I'm sure there's got to be something similar in MP. For example my girlfriend wanted the Pimoroni Tufty2040 which has 65K (RGB 565) support. Well I quickly found out one image at 565RBG would crash the Pico because MP had eaten up on the RAM. Fortunately I found a way around with with some clever people. I converted the image into raw code with a little help from GIMP or Photoshop and a custom python program I found on the web that did the conversion. I was left with a .bin image file. I copied that over using Thonny and I was able to load as many pictures as I could store on the Tufty (it has 8MB of non RAM storage and each image in raw conversion was about 150Kb. This was for a ST7789 graphics driver. I don't know MP at all but I stumbled through just enough to get the Tufty2040 working at RGB565 (65K colors) in MP. The Tufty2040 C++ code was a hot mess so I figured MP was best. Email Waveshare support directly. They are AWESOME in helping out. I bug them all the time lol they probably know me by name. I also spend money in return! They are slow to respond but they always help out in one way or another. |
I also would highly appreciate sample MicroPython code how to show simple images (eg pbm files / bytearrays). |
You can find pbm tutorial here |
Yes.. my level of knowledge doesn't know how to display bitmaps. Can you please update this?
The text was updated successfully, but these errors were encountered: