A simple 30 line function for writing an uncompressed TGA file