#include #include int main(int argc, char *argv[]) { FILE *tga, *raw; int r, g, b; int i; if (argc < 3) exit(1); if ((tga = fopen(argv[1], "rb")) == NULL) exit(2); if ((raw = fopen(argv[2], "wb")) == NULL) exit(3); fseek(tga, 0x12, 0); i = 0; while (i < 256 * 256) { b = getc(tga); g = getc(tga); r = getc(tga); putc(r, raw); putc(g, raw); putc(b, raw); i++; } return 0; }