iNDexed Image format - consider itself lucky.
cmd/ndiconv | ||
.envrc | ||
.gitignore | ||
flake.lock | ||
flake.nix | ||
go.mod | ||
LICENSE | ||
ndi.go | ||
README.md | ||
shell.nix |
ndi
iNDexed Image format - consider itself lucky.
This is the Go reference for ndi
v1.
Format
Header
magic string: ndi1
image width: uint16
LUT/palette size: uint8 (maximum of 255 colors)
zero pad until 12 bytes
ndi1 WWL0 0000
LUT (lookup table) / palette
3x uint8 in RGB order, per LUT index.
zero pad: 32 bits
Pixels
a uint8 per pixel, referencing the color within the LUT, zero indexed.
Decoding Quirks
Pixels should modulo their value with LUT size. A pixel referencing index 0xEF when only 10 colors exist in the LUT, 0xEF % 10
is the correct interpretation.