Skip to main content

luma.core | luma.docs | luma.emulator | luma.examples | luma.lcd | luma.led_matrix | luma.oled

luma.oled

Display drivers for SSD1305 / SSD1306 / SSD1309 / SSD1315 / SSD1316 / SSD1322 / SSD1325 / SSD1327 / SSD1331 / SSD1351 / SSD1362 / SSD1363 / SH1106 / SH1107 / WS0010 / CH1115

https://github.com/rm-hull/luma.oled/actions/workflows/main.yml/badge.svg https://coveralls.io/repos/github/rm-hull/luma.oled/badge.svg?branch=main https://readthedocs.org/projects/luma-oled/badge/?version=latest https://img.shields.io/pypi/pyversions/luma.oled https://img.shields.io/pypi/v/luma.oled

Python 3 library interfacing OLED matrix displays with the SSD1305, SSD1306, SSD1309, SSD1315, SSD1316, SSD1322, SSD1325, SSD1327, SSD1331, SSD1351, SSD1362, SSD1363, SH1106, SH1107 or WS0010 driver using I2C/SPI/Parallel on the Raspberry Pi and other linux-based single-board computers - it provides a Pillow-compatible drawing canvas, and other functionality to support:

  • scrolling/panning capability,

  • terminal-style printing,

  • state management,

  • color/greyscale (where supported),

  • dithering to monochrome

Documentation

Full documentation with installation instructions and examples can be found on https://luma-oled.readthedocs.io.

A list of tested devices can be found in the wiki.

The display pictured below is a SSD1306 (128 x 64 pixels), and the board is tiny enough to fit inside the RPi case.

mounted ssd1322

As well as display drivers for various physical OLED devices, there are emulators that run in real-time (with pygame) and others that can take screenshots, or assemble animated GIFs, as per the examples below (source code for these is available in the luma.examples git repository:

clock invaders crawl

Upgrade

Version 2.0.0 was released on 11 January 2017: this came with a rename of the github project from ssd1306 to luma.oled to reflect the changing nature of the codebase.

Some core functionality has been moved out to another git repository, luma.core: this has enabled another project to have a facelift: pcd8544 has now been reborn as luma.lcd: the same API can now be used across both projects. Likewise max7219 has been renamed to luma.led_matrix so it can also take advantage of the common API.

The consequence is that any existing code that uses the old ssd1306 package will need to be updated. The changes should be limited to altering import statements only, and are described in the upgrade documentation.

License

The MIT License (MIT)

Copyright (c) 2014-2026 Richard Hull and contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

Pull requests (code changes / documentation / typos / feature requests / setup) are gladly accepted. If you are intending to introduce some large-scale changes, please get in touch first to make sure we’re on the same page: try to include a docstring for any new method or class, and keep method bodies small, readable and PEP8-compliant. Add tests and strive to keep the code coverage levels high.

GitHub

The source code is available to clone at: https://github.com/rm-hull/luma.oled

Contributors

  • Thijs Triemstra (@thijstriemstra)

  • Christoph Handel (@fragfutter)

  • Boeeerb (@Boeeerb)

  • xes (@xes)

  • Roger Dahl (@rogerdahl)

  • Václav Šmilauer (@eudoxos)

  • Claus Bjerre (@bjerrep)

  • Vx Displays LLC (@VxGeeks)

  • Christopher Arndt (@SpotlightKid)

  • Sascha Walther (@leragequit)

  • Marcus Kellerman (@sharkusk)

  • Phil Howard (@gadgetoid)

  • @wjgeorge

  • Doug Burrell (@doug-burrell)

  • Xavier Carcelle (@xcarcelle)

  • Dhrone (@dhrone)

  • George Harker (@georgeharker)

  • @Pako2

  • Graeme Smecher (@gsmecher)

  • Romit Raj (@QuicksandDesignStudio)

  • René Girardi (@WikiZell)

  • Robert Kihlberg (@Kihltech)

ChangeLog

Version

Description

Date

3.16.0

  • Add support for SSD1363

  • Remove deprecation notice in framebuffer mixin

  • Make page_address_offset configurable for SH1106 displays

2026/10/02

3.15.0

  • Add support for 128x64 CH1115

  • Add support for SSD1305

  • Add support for SSD1315

  • Add support for SSD1316

  • Fix sh1106 display of a rotated image

  • Drop support for Python 3.8

2026/03/05

3.14.0

  • Drop support for Python 3.7

2024/10/26

3.13.0

  • Add support for 128x128 SH1107

2023/08/12

3.12.0

  • Fix 96x16 OLED panel offset

2023/03/19

3.11.0

  • Add support for SH1107 greyscale OLED

2023/01/26

3.10.0

  • Fix SSD1322 NHD initialization and encode each pixel as 4bit+4bit identical nibbles

2022/11/14

3.9.0

  • Use native namespace package configuration

  • Drop support for Python 3.6

2022/10/19

3.8.1

  • Fix mutable default parameter bug when using multiple displays

2020/11/15

3.8.0

  • Improved diff_to_previous framebuffer performance

2020/11/06

3.7.0

  • Drop support for Python 3.5, only 3.6 or newer is supported now

  • Add support for SSD1351 128x96 display

  • Pin luma.core to 1.x.y line only, in anticipation of performance improvements in upcoming major release

2020/10/25

3.6.0

  • Add support for Winstar OLED displays

2020/09/24

3.5.0

  • Drop support for Python 2.7, only 3.5 or newer is supported now

2020/07/04

3.4.0

  • Add support for SSD1362 256x64 Greyscale OLED

2020/01/19

3.3.0

  • Namespace fix

2019/06/19

3.2.1

  • Fix bug where SSD1325 framebuffer=diff_to_prev didn’t set column address properly, resulting in garbled output

2019/04/30

3.2.0

  • Add support for 128x64 OLED (Newhaven SSD1322_NHD))

2019/04/17

3.1.1

  • Fix bug where SSD1327 framebuffer=diff_to_prev didn’t set column address properly, resulting in garbled output

  • Minor API documentation improvements

2019/03/30

3.1.0

  • Add support for 128x64 monochrome OLED (SSD1309)

2018/12/21

3.0.1

  • Fix bug where SSD1325/1327 didn’t handle framebuffer properly

2018/12/21

3.0.0

  • BREAKING Fix SSD1351 init sequence didn’t set RGB/BGR color order properly. Users of this device should verify proper color rendering and add bgr=True if blue/red color components appear to be reversed

  • Device consolidation - greyscale and colour SSD13xx devices now share common base classes.

2018/12/02

2.5.1

  • Fix bug where SSD1331/1351 didn’t render green accurately

2018/09/14

2.5.0

  • Add support form 128x128 Monochrome OLED (SH1106) (by @Gadgetoid)

  • Dependency and documentation updates

  • Minor packaging changes

2018/09/07

2.4.1

  • Fix bug where SSD1327 init sequence exceeds serial command size

2018/05/28

2.4.0

  • Support for 128x128 4-bit OLED (SSD1327)

2018/04/18

2.3.2

  • Support for 96x96 color OLED (SSD1351)

2018/03/03

2.3.1

  • Changed version number to inside luma/oled/__init__.py

2017/11/23

2.3.0

  • Support for 128x128 color OLED (SSD1351)

2017/10/30

2.2.12

  • Explicitly state ‘UTF-8’ encoding in setup when reading files

2017/10/18

2.2.11

  • Update dependencies

  • Additional troubleshooting documentation

2017/09/19

2.2.10

  • Add support for 128x32 mode for SH1106

2017/05/01

2.2.9

  • luma.core 0.9.0 or newer is required now

  • Documentation amends

2017/04/22

2.2.8

  • SSD1331 & SSD1322 framebuffer & API docstrings

2017/04/13

2.2.7

  • Add support for 64x32 SSD1306 OLED

2017/04/12

2.2.6

  • Add support for 64x48 SSD1306 OLED

2017/03/30

2.2.5

  • Restrict exported Python symbols from luma.oled.device

2017/03/02

2.2.4

  • Tweaked SSD1325 init settings & replaced constants

  • Update dependencies

2017/02/17

2.2.3

  • Monochrome rendering on SSD1322 & SSD1325

2017/02/14

2.2.2

  • SSD1325 performance improvements (perfloop: 25.50 –> 34.31 FPS)

  • SSD1331 performance improvements (perfloop: 34.64 –> 51.89 FPS)

2017/02/02

2.2.1

  • Support for 256x64 4-bit greyscale OLED (SSD1322)

  • Improved API documentation (shows inherited members)

2017/01/29

2.1.0

  • Simplify/optimize SSD1306 display logic

2017/01/22

2.0.1

  • Moved examples to separate git repo

  • Add notes about breaking changes

2017/01/15

2.0.0

  • Package rename to luma.oled (Note: Breaking changes)

2017/01/11

1.5.0

  • Performance improvements for SH1106 driver (2x frame rate!)

  • Support for 4-bit greyscale OLED (SSD1325)

  • Landscape/portrait orientation with rotate=N parameter

2017/01/09

1.4.0

  • Add savepoint/restore functionality

  • Add terminal functionality

  • Canvas image dithering

  • Additional & improved examples

  • Load config settings from file (for examples)

  • Universal wheel distribution

  • Improved/simplified error reporting

  • Documentation updates

2016/12/23

1.3.1

  • Add ability to adjust brightness of screen

  • Fix for wrong value NORMALDISPLAY for SSD1331 device

2016/12/11

1.3.0

  • Support for 16-bit color OLED (SSD1331)

  • Viewport/scrolling support

  • Remove pygame as an install dependency in setup

  • Ensure SH1106 device collapses color images to monochrome

  • Fix for emulated devices: do not need cleanup

  • Fix to allow gifanim emulator to process 1-bit images

  • Establish a single threadpool for all virtual viewports

  • Fix issue preventing multiple threads from running concurrently

  • Documentation updates

2016/12/11

1.2.0

  • Add support for 128x32, 96x16 OLED screens (SSD1306 chipset only)

  • Fix boundary condition error when supplying max-frames to gifanim

  • Bit pattern calc rework when conveting color -> monochrome

  • Approx 20% performance improvement in display method

2016/12/08

1.1.0

  • Add animated-GIF emulator

  • Add color-mode flag to emulator

  • Fix regression in SPI interface

  • Rename emulator transform option ‘scale’ to ‘identity’

2016/12/05

1.0.0

  • Add HQX scaling to capture and pygame emulators

  • SPI support (NOTE: contains breaking changes)

  • Improve benchmarking examples

  • Fix resource leakage & noops on emulated devices

  • Additional tests

2016/12/03

0.3.5

  • Pygame-based device emulator & screen capture device emulator

  • Add bouncing balls demo, clock & Space Invaders examples

  • Auto cleanup on exit

  • Add bounding_box attribute to devices

  • Demote buffer & pages attributes to “internal use” only

  • Replaced SH1106 data sheet with version that is not “preliminary”

  • Add font attribution

  • Tests for SSD1306 & SSH1106 devices

  • Add code coverage & upload to coveralls.io

  • flake8 code compliance

  • Documentation updates

2016/11/30

0.3.4

  • Performance improvements - render speeds ~2x faster

  • Documentation updates

2016/11/15

0.3.3

  • Add PyPi badge

  • Use smbus2

2016/11/15

0.3.2

  • Fix bug in maze example (integer division on python 3)

  • Use latest pip

  • Add tox & travis config (+ badge)

  • Add RTFD config

  • Documentation updates

2016/11/13

0.3.1

  • Adjust requirements (remove smbus)

  • Default RTFD theme

  • Documentation updates

2016/11/13

0.3.0

  • Allow SMBus implementation to be supplied

  • Add show, hide and clear methods

  • Catch & rethrow IOError exceptions

  • Fix error in ‘hello world’ example

  • Cleanup imports

  • Allow setting width/height

  • Documentation updates

2016/11/13

0.2.0

  • Add Python 3 support

  • Add options to demos

  • Micro-optimizations

  • Remove unused optional arg

  • Fix bug in rendering image data

  • Added more examples

  • Add setup file

  • Support SH1106

  • Documentation updates

2016/09/06

Metadata

Release files for luma.oled 3.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for luma.oled 3.16.0
File Size Uploaded
luma_oled-3.16.0.tar.gz 20.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for luma.oled 3.16.0
File Interpreter ABI Platform
luma_oled-3.16.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.9 MB

Release files / luma_oled-3.16.0.tar.gz

Download URL luma_oled-3.16.0.tar.gz
Size 20.9 MB
Tags Source
SHA-256 checksum
How to use checksums
9e5df928b11c4622872d0da25dd90186ca5e4c1cf1c01b562e7cda86f877f437
BLAKE2b-256 checksum
How to use checksums
bb3d5f834b9c9f977687b96835110eb9295affd29519249f9c7acc13f71968f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / luma_oled-3.16.0-py3-none-any.whl

Download URL luma_oled-3.16.0-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d863b759472b41ef3a75ddb9532100ce1d26042707d43472b5687b673e4e523
BLAKE2b-256 checksum
How to use checksums
12e10be3c65fcd315cccf86d8f00633585c23426600f1c1350099cc03d881c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

3.16.0 This release

2 release files

3.13.0

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.9.0

2 release files

3.8.1

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.12

2 release files

2.2.11

2 release files

2.2.9

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

1 release file

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page