I am working in C on a physics experiment, Young\'s interference experiment and i made a program who prints to file a huge bunch of pixels :
file
for
You probably want to use the PPM format which is what you're looking for: a minimal header followed by raw RGB.