So I did the thing again.
I forgot this project existed.
Like fully.
Brain: empty.
Me: “oh yeah, I built a whole image format once.”
So anyway, here’s the “everything I did up to now” devlog because apparently I built an entire bitmap ecosystem and then moved on and forgot about it.
So. tBMP.
Right.
This started as “haha what if I made a tiny bitmap format because BMP is so… bad.” and then spiraled into “oh god I’m writing a whole C library and a schema and a test suite and a CLI tool and a docs site and-”
Classic me 😭
The Format
I wanted something simple.
Like:
- predictable
- tiny
- no: update one thing? fine let me calculate everything else
- and also because i wanted to >:3
So tBMP is literally:
HEADER
DATA
EXTRA
META
Does that format seem familiar? Anyone who has seen my “ideal music format” should know it as I might have borrowed it hehe.
It’s just the best way to make a binary format, smh my head
Encodings
I could’ve stopped at RAW.
But no.
Now we have:
- RAW
- RLE
- Zero‑Range
- Span
- Sparse Pixel
- Block‑Sparse
it’s so great omg the docs heheeeeeeeeeeeee: https://nellowtcs.me/tBMP/docs/guide/encoding/
EXTRA
This is where palettes and masks live.
And also anything else I decide to shove in there.
It’s literally:
- 4‑byte tag
- 4‑byte length
- body
Simple.
Predictable.
Unlike PNG which is like “here’s a chunk, good luck.”
Metadata
Currently metadata is just “throw some key-value pairs, not my problem’
It’s now going to be structured because apparently I care about standards (lie /j):
- title
- author
- description
- created
- software
- dpi
- colorspace
- tags
- license
- comment
- more idk what
Plus custom fields because I’m not a monster.
The Library
The codebase is split into modules like a real grown‑up library:
- reader
- decoder
- writer
- metadata
- msgpack
- pixel helpers
- rotation transforms
Everything is tiny, just like the format (gosh, I’ve been wanting to make that joke for ages now)
The Test Suite (not tiny smh my head again)
There are tests for:
- decoding
- encoding
- metadata
- edge cases
- sparse pixels
- block‑sparse
- rotation
- reader
- writer
It’s… a lot.
(so much handwritten things like i often had to write binary by hand which was so much pain i hate it but i will do it again cause i’m silly and it’s kinda the fastest way to do it)
Docs
DocMD is great
Mic drop.
Stuff I did these two commits
- prettified like a bunch tables in the docs
- added metadata validation helpers
- added metadata round‑trip tests
- added malformed MsgPack tests
- added malformed EXTRA tests
- added sparse/block‑sparse edge case tests
- checked off TODOs like a gremlin on a speedrun
- updated TODO.md
What’s Left (haha everything)
There’s a TODO.md, go read it