iNDexed Image format - consider itself lucky.
Find a file
2024-11-03 22:39:52 -08:00
cmd/ndiconv ndi! 2024-11-03 22:39:52 -08:00
.envrc ndi! 2024-11-03 22:39:52 -08:00
.gitignore ndi! 2024-11-03 22:39:52 -08:00
flake.lock ndi! 2024-11-03 22:39:52 -08:00
flake.nix ndi! 2024-11-03 22:39:52 -08:00
go.mod ndi! 2024-11-03 22:39:52 -08:00
LICENSE Initial commit 2024-11-04 01:55:35 +00:00
ndi.go ndi! 2024-11-03 22:39:52 -08:00
README.md ndi! 2024-11-03 22:39:52 -08:00
shell.nix ndi! 2024-11-03 22:39:52 -08:00

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.