Skip to content

Full-frame updates send ABGR instead of BGRA #6

Description

@dougvk

Hey — there’s a byte-order/alpha bug in tinyturing/display.py.

Pixels are stored as 0xRRGGBB00, so .tobytes() sends 00 B G R on little-endian machines. Rev C full frames expect opaque BGRA: B G R FF. Partial updates are fine because they explicitly send BGR.

On a 5" Red v2 this made white yellow and pure red/green/blue black. Confirmed with an eight-color test grid.

This fixes both full-refresh paths:

-framebuffer = self.framebuffer.transpose().tobytes()
+framebuffer = ((self.framebuffer.transpose() >> 8) | np.uint32(0xff000000)).tobytes()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions