Output Image to file

not really.

you have to use glReadPixels to read the color values from the framebuffer; afterwards you have to create the image file by yourself. you should use uncompressed targa format (*.tga), for a start.