Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/rm-hull/luma.oled/llms.txt

Use this file to discover all available pages before exploring further.

Different OLED controllers support different color depths. luma.oled handles the conversion automatically — you draw with standard Pillow color values and the library downsizes the image to match what the hardware can display. The behavior depends on which device class you are using.

Monochrome displays

Supported devices: SSD1305, SSD1306, SSD1309, SSD1315, SSD1316, SH1106, SH1107, WS0010, CH1115These displays are strictly black and white. Any color value other than black is treated as white. Use the HTML color names "black" and "white" for clarity.
with canvas(device) as draw:
    draw.rectangle(device.bounding_box, outline="white", fill="black")
    draw.text((30, 40), "Hello World", fill="white")

Dithering

If you want to render a color image on a monochrome display, set dither=True on the canvas. luma.oled will convert the color drawing to a dithered monochrome effect:
with canvas(device, dither=True) as draw:
    draw.rectangle((10, 10, 30, 30), outline="white", fill="red")
Any PIL.ImageColor format is accepted — but on monochrome hardware, only black vs. non-black is meaningful unless you enable dithering.

Build docs developers (and LLMs) love