Convert any image to .pbm
for MicroPython with GIMP
(Updated at 12/13/2023)
The easiest way to display an image on a monochrome screen in MicroPython is to have an image in the .pbm
format. The PBM format was created in the 1980s as a raster graphics monochrome images that can be transmitted via** an electronic message in ASCII text
Note
Except for this kind of application (displayed on a monochrome screen), it is no longer used.
With this image format, you can save it directly in the flash memory of your board (in MicroPython), read it in Python like a classic file and display it on your screen in 2 lines of code, thanks to the framebuf
.
The most suitable tool for the conversion is the software GIMP (Free and Open Source Photoshop)
It can also be used to modify the image.
Force the image to be in black and white
If your image is originally in color, you must convert it to monochrome. To do this, go to the menu Image → Mode → Indexed Colors…
This article is available to premium members only. You still have 59% to discover.
Subscribe for only 5$/monthAlready subscribed? Sign in