This is a GIMP plug-in written in Python language that exports layers as separate images in (almost) any file format supported by GIMP, possibly including third party plug-ins.
From the main menu, go to "File -> Export Layers...". A dialog appears, allowing you to specify the output directory, output file format for all layers and several options adjusting the output.
To specify file format, type file extension corresponding to the file format in the text field (with or without the leading dot). All file formats except OpenRaster (.ora) and Colored XHTML (.xhtml) are supported, including XCF format native to the GIMP. File formats provided by third party plug-ins should theoretically work as well - at the very least, GIMP DDS Plugin was tested and works correctly. To export in raw file format (which has no file extension assigned), type "raw" into the text field. However, the extension will eventually be stripped from the raw files.
To finally export layers, click the "Export Layers" button. For the first file, a window corresponding to the file format export appears, allowing you to adjust format settings. Not all file formats have settings, so no window may appear depending on the file format you specified. For the subsequent files, the file export procedure uses the values you specified in the window for the first file.
If you want to repeat the export with last used settings (without displaying the dialog window), use "File -> Export Layers to" from the main menu.
Treat layer groups as directories
If checked, layer groups are treated as directories. This means that a directory structure is created and the layers will be exported to the subdirectories corresponding to the respective layer groups they belong to.
If unchecked, all layers will be exported to the output directory on the same directory level and no subdirectories will be created.
Ignore invisible layers
If checked, invisible layers will not be exported. Visible layers within invisible layer groups will also not be exported.
If checked, layers will be autocropped before being exported.
Use image size instead of layer size
If checked, layers will be resized to the image (canvas) size. If layers are partially outside the image canvas, they will be cut off, thus if you want to export the entire layer, leave this option unchecked.
To install, extract the export_layers.py file from the attached .zip archive to your plug-ins directory ([home directory]/.gimp-2.8/plug-ins).
September 08, 2013
* Added "Export Layers to" option, repeating the export with last used settings.
For more information, such as known issues, see the beginning of the export_layers.py file.