I made my own image format!

I made my own image format!

Apr 6, 2025

Well, of course I did. It's called NVGIF (Not Very Good Image Format), and it works!

AirSquirrel now supports viewing NVGIF pictures, just like PNGs!

NVGIFv1 worked like this:

  • Magic bytes: "NVG"
    Every NVGIF image starts with these three bytes.
  • Version: The byte \x01 (00000001 in binary) for v1.
  • Width: 2-byte big-endian number.
    "Big-endian" just means that 200 is 00 C8 instead of C8 00. Kind of like if we wrote 2578 as 7825.
  • Height: 2-byte big-endian number.
  • Then, for each row in the image:
    • A two-byte, big-endian header with the length of the row.
    • For each pixel in the row:
      • One byte for red
      • One byte for blue
      • One byte for green

More info can be found here.