git clone http://ratfactor.com/repos/tga.zig/tga.zig.git
This program demonstrates writing TGA “targa” image files by writing a pretty gradient.

TGA is easy to write and has wonderfully software support, but there are a couple “gotchas” in the header and image data, namely:
https://en.wikipedia.org/wiki/Truevision_TGA