Skip to content

Bug: Red and Blue channels swapped on Waveshare Spectra 6 displays #638

@Gentoshi

Description

@Gentoshi

Prerequisites

Please confirm the following:

  • I have searched open and closed issues to make sure it isn't already reported
  • I reviewed the troubleshooting guide
  • I reviewed InkyPi service logs and will paste any relevant logs below

Describe the bug
When rendering images on a Waveshare Spectra 6 (E6) multi-color display, the Red and Blue color channels are swapped. This results in blue areas of a source image displaying as orange/red on the physical e-ink panel.

This happens because the Pillow library processes and outputs images in RGB format, but the underlying Waveshare hardware driver expects the image buffer to be in BGR format. Currently, waveshare_display.py passes the RGB image directly to getbuffer() without reordering the channels.

Expected behavior
The colors rendered on the e-ink display should accurately reflect the source image without the red and blue channels being inverted.

To Reproduce
Steps to reproduce the behavior:

  1. Configure InkyPi to use a Waveshare Spectra 6 display (e.g., epd7in3e).
  2. Upload or display an image that contains prominent blue colors.
  3. Wait for the screen to refresh.
  4. Observe that the blue areas render as orange/red on the physical display.

Logs
No crash or error logs are generated, as this is a visual rendering/color mapping bug, not a runtime exception. The service continues to run normally.

Additional context

  • Hardware: Raspberry Pi Zero W 2, Waveshare 7.3" Spectra 6 (E6) Display.
  • Local Fix Applied: I was able to fix this locally by intercepting the image right before it converts to the buffer and manually swapping the channels.

In src/display/waveshare_display.py inside the display_image function (around line 130), I added this block just before if not self.bi_color_display::

        # --- BGR Swap Fix ---
        if image.mode == "RGB":
            r, g, b = image.split()
            image = Image.merge("RGB", (b, g, r))
        elif image.mode == "RGBA":
            r, g, b, a = image.split()
            image = Image.merge("RGBA", (b, g, r, a))
        # --------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions