Save cubemap to file

whats an easy and uncomplicated way to save a cubemap which has been rendered into a framebufferobject into a file (e.g. 6 separate pngs, one for each side)?
I have a fbo with a cubemap attached and filled all six textures (GL_TEXTURE_CUBE_MAP_POSITIVE_X, …).


If you want to use the png format, people tend to use libpng or a higher level library that uses libpng under the hood.
Links for such libraries are here

If you want to save as a single file, look into the DDS format. DevIL supports DDS.