Skip to content

uPesy ships directly only in France !

uPesy products available on Amazon for EU

Contents Menu Expand Light mode Dark mode Auto light/dark mode

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


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)

open image GIMP

Gimp is the right software to edit images for small screens

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…

convert color image to monochrome

Check the box : Use a black and white palette (1bit)

This article is available to premium members only. You still have 59% to discover.

Subscribe for only 5$/month

Already subscribed? Sign in