question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem about SSD1351 device color format converting

See original GitHub issue

Class: luma.oled.device.ssd1351 Funtion: display

Origin:

for r, g, b in self.framebuffer.getdata():
    if not(r == g == b == 0):
        # 65K format 1
        buf[i] = r & 0xF8 | g >> 5
        buf[i + 1] = g << 5 & 0xE0 | b >> 3
    i += 2

This code try to convert color RGB(888) to color 65K(565) Convert: rrrrrrrr,gggggggg,bbbbbbbb -> rrrrr ggg,ggg bbbbb when deal with the green byte, bit 76543210 should be convert to 765,432 but actually we get 765,210, the green color changed randomly.

The correct code is:

for r, g, b in self.framebuffer.getdata():
    if not(r == g == b == 0):
        # 65K format 1
        buf[i] = r & 0xF8 | g >> 5
        buf[i + 1] = g << 3 & 0xE0 | b >> 3
    i += 2

green byte just need to left shift by 3, not 5

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rm-hullcommented, Sep 14, 2018

2.5.1 released onto PyPi with this fix in

1reaction
rm-hullcommented, Sep 11, 2018

also note that SSD1331 driver is similarly affected

Read more comments on GitHub >

github_iconTop Results From Across the Web

OLED 128x128 is not displaying correctly the colors
I'm having trouble using the OLED SSD1351 ...
Read more >
Color conversion and ink management (Acrobat Pro)
This conversion is applied to all untagged spaces, RGB, CMYK and grayscale, whether stand-alone or as alternate value for spot colors. Objects ...
Read more >
Best Practices for Color Management in OS X and iOS
You can convert color from one color space to another through a mathematical conversion called gamut mapping, but it really depends on which ......
Read more >
Optimized SSD1351 library with buffering [Archive]
The fastest frame rate achievable is about 80fps, using no buffering and low colour mode, writing a solid colour to the screen. In...
Read more >
Color management - Affinity Online Help
As not all devices can display the same color gamut it can lead to colors ... (Color option), check the Convert opened files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found