dds_png: decode packed B5 color previews #2314

Merged
ZroIsHere merged 1 commit from upstream-pr/2314 into main 2026-11-26 18:28:49 +00:00
ZroIsHere commented 2026-11-26 13:45:19 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ZroIsHere on 2026-11-26T13:45:19Z.


Add PNG preview decoding for DXGI B5G6R5_UNORM (format 85) and B5G5R5A1_UNORM (format 86) DDS textures. Expand the packed 5/6-bit color channels to 8-bit RGBA; B5G5R5A1 preserves its one-bit alpha channel.

The decoder validates row pitch and truncated payloads. Update the tex_export.py help text to list the new preview formats.

Validation

  • git diff --check
  • Python AST parse
  • Tests not run.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5511161101 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2314). Originally posted by [ZroIsHere](https://github.com/ZroIsHere) on 2026-11-26T13:45:19Z. --- Add PNG preview decoding for DXGI B5G6R5_UNORM (format 85) and B5G5R5A1_UNORM (format 86) DDS textures. Expand the packed 5/6-bit color channels to 8-bit RGBA; B5G5R5A1 preserves its one-bit alpha channel. The decoder validates row pitch and truncated payloads. Update the tex_export.py help text to list the new preview formats. ## Validation - git diff --check - Python AST parse - Tests not run.
aslan2142 commented 2026-11-26 18:28:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-26T18:28:58Z.


Merged through the integration PR #2394 (DDS preview formats batch), as head 3e8c273d6, with a merge commit, so your commits stay yours.

Added on top:

  • Test: a synthetic test for B5G6R5 and B5G5R5A1. It covers channel order, the alpha bit, bit replication, padded rows and truncation.
  • Docstring: the indexer does not list DXGI 85 and 86, so tex_export.py --png cannot reach them yet. Its docstring no longer lists them. The standalone dds_png.py decodes both.

Thanks @ZroIsHere.

AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7200512837 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/2314#issuecomment-7200512837). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-26T18:28:58Z. --- Merged through the integration PR #2394 (DDS preview formats batch), as head `3e8c273d6`, with a merge commit, so your commits stay yours. Added on top: - **Test:** a synthetic test for B5G6R5 and B5G5R5A1. It covers channel order, the alpha bit, bit replication, padded rows and truncation. - **Docstring:** the indexer does not list DXGI 85 and 86, so `tex_export.py --png` cannot reach them yet. Its docstring no longer lists them. The standalone `dds_png.py` decodes both. Thanks @ZroIsHere. AI-assisted (Claude Code, Claude Opus 5.5 and Claude Fable 5.2)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2314
No description provided.