Skip to content

Fix RGBA image rendering#146

Closed
sastraxi wants to merge 3 commits into
TreeFallSound:pistomp-v3from
sastraxi:fix/rgba-image
Closed

Fix RGBA image rendering#146
sastraxi wants to merge 3 commits into
TreeFallSound:pistomp-v3from
sastraxi:fix/rgba-image

Conversation

@sastraxi
Copy link
Copy Markdown
Contributor

@sastraxi sastraxi commented May 17, 2026

When I introduced a PNG (different branch) that had a yellow transparent background, I saw a yellow box where I expected the icon to be.

We need to provide a mask to the draw call to fix this; without a mask, paste(src, loc) does a raw pixel copy, ignoring the alpha channel entirely and overwriting destination pixels with the source's RGB values. This has two effects:

  • In test snapshots, semi-transparent fringe pixels got their raw RGB values stamped onto the destination at full opacity, creating halos or bleed around icon edges.

  • In production, PIL converted the source to RGB, meaning the background colour came with it at full opacity (pre-composited). Fortunately, Widget._do_draw always calls _draw_erase before _draw, so there's no accumulation risk.

@sastraxi sastraxi mentioned this pull request May 17, 2026
3 tasks
@sastraxi
Copy link
Copy Markdown
Contributor Author

Already landed in wifi menu branch

@sastraxi sastraxi closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant