Decoding REXPaint Files in Odin

tylerelton 23 points 2 comments November 10, 2026
tylerelton.com · View on Hacker News

Discussion Highlights (2 comments)

MiroslavPokorny

Sounds like something kool to read. Thanks for sharing!

skrellm

Nice, but the description and the code disagrees on the file format. I believe this struct File :: struct { version: i32, layers: []Layer, } Should be File :: struct { version: i32, count: i32, layers: []Layer, } Also it's a bit dumb to store a CP437 character on i32 because that codepage has only 256 entries (meaning 3 zero bytes overhead for every cell). All in all I would rather store such character art in ANSI escape sequences (that's actually a sort of run-length-encoding), much smaller files, easier to decode. FYI, besides REXPaint, there were other binary ANSI art formats too, like BIN and XBIN ( https://deepwiki.com/andre-simon/ansifilter/7.4-bin-and-xbin... ), but those could not break the hegemony of ANSI escape sequences either.

Semantic search powered by Rivestack pgvector
3,874 stories · 35,194 chunks indexed