Skip to content

Conversation

@burnhamrobertp
Copy link
Contributor

@burnhamrobertp burnhamrobertp commented Feb 8, 2026

Original PR: #30

Fixes beyond-all-reason/maps-metadata#567

When processing the DXT1 lookup on each block, there is a bug in color ordering, causing them to be swapped. This caused the 2-bit pixel indices to map to wrong colors, resulting in visible artifacts. This PR also updated the RGB565 conversion to use simple bit shifting instead of bit replication, which produces smoother gradients matching the reference python implementation.

Will not require any changes in maps-metadata besides a version update

Contains AI-assisted changes:

  • parse-dxt.ts:getComponentsFromRGB565 - duplicates a small portion of the python implementation (which was generated using an unknown model) for implementing a color bitshift. This different approach produces smoother color gradienting

Conflicts:

src/map-parser.ts

src/parse-dxt.ts

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.

Improve quality of generated texture image

1 participant