1st - Grab the specs of tga from http://www.wotsit.org
2nd - Read them
3rd - Prepare yourself for a loooong time of programming
4th - Start programming
5th - See if it works