← Back to Specifications
NVGIF (Not Very Good Image Format) is a lightweight, modular image format designed for efficiency, transparency, and compression. Each version builds upon the last, introducing new features while maintaining simplicity and compatibility.
NVGIFv1 — The Core
| Offset (bytes) |
Size (bytes) |
Description |
0 |
3 |
Magic Bytes (NVG) |
3 |
1 |
Version (1) |
4 |
2 |
Width (big-endian) |
6 |
2 |
Height (big-endian) |
Features
- ✅ Raw RGB format (no compression)
- ✅ No alpha support
- ✅ Simple row encoding (
Width × 3 bytes per pixel)
Pixel Data
- Each row starts with a row length field (
2 bytes, big-endian).
- Raw RGB pixels (
3 bytes per pixel).
NVGIFv2 — Compression Introduced
| Offset (bytes) |
Size (bytes) |
Description |
0 |
3 |
Magic Bytes (NVG) |
3 |
1 |
Version (2) |
4 |
1 |
Compression Type (0 = None, 1 = RLE) |
5 |
2 |
Width (big-endian) |
7 |
2 |
Height (big-endian) |
Features
- ✅ Supports RLE compression (row-wise, optional)
- ✅ Still lacks alpha support
- ✅ More compact storage
Pixel Data
- Compression Type dictates raw vs. RLE storage.
- Row-based encoding, but RLE can significantly reduce redundancy.
NVGIFv3 — Alpha Support & Full Compression
| Offset (bytes) |
Size (bytes) |
Description |
0 |
3 |
Magic Bytes (NVG) |
3 |
1 |
Version (3) |
4 |
1 |
Compression Type (0 = None, 1 = RLE) |
5 |
1 |
Alpha Flag (0 = Off, 1 = On) |
6 |
2 |
Width (big-endian) |
8 |
2 |
Height (big-endian) |
Features
- ✅ Alpha channel support (RGBA format)
- ✅ Compression retained (
None or RLE)
- ✅ Flexible encoding
Pixel Data
- Compression (
None vs. RLE) applies per row.
- Alpha flag determines RGB (
3 bytes per pixel) or RGBA (4 bytes per pixel).
Version Comparison
| Feature |
NVGIFv1 |
NVGIFv2 |
NVGIFv3 |
| Magic Bytes |
NVG |
NVG |
NVG |
| Version Byte |
✅ (1) |
✅ (2) |
✅ (3) |
| Compression |
❌ None |
✅ RLE (optional) |
✅ RLE (optional) |
| Alpha Support |
❌ None |
❌ None |
✅ RGBA support |
| Row Structure |
Raw RGB |
Raw or RLE |
Raw or RLE + Alpha |