tinygrad / tinygrad/tinyos

Full-frame updates send ABGR instead of BGRA

Open Beginner friendly
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
50
Forks
8
PR merge metrics
No merged PRs in 30d

Description

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()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tinyturing/display.py and locate both full-refresh paths, then compare their byte order with the partial-update path. Verify that full frames use opaque BGRA for the Rev C display and confirm the result with the eight-color test grid.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.