4. Files

The Gimp is capable of reading and writing a large variety of graphics file formats. With the exception of Gimp's native XCF file type, file handling is done by plug-ins. Thus, it is relatively easy to extend Gimp to new file types when the need arises.

Not all file types are equally good for all purposes. This part of the documentation should help you understand the advantages and disadvantages of each type.

Overview

When you open a file, using the File menu or any other method, Gimp needs to determine what type of file it is. Unless there is no alternative, Gimp does not simply rely on the extension (such as ".jpg") to determine the file type, because extensions are not reliable: they vary from system to system; any file can be renamed to have any extension; and there are many reasons why a file name might lack an extension. Instead, Gimp first tries to recognize a file by examining its contents: most of the commonly used graphics file formats have "magic headers" that permit them to be recognized. Only if the magic yields no result does Gimp resort to using the extension.

The Export dialog

There is no file format, with the exception of Gimp's native XCF format, that is capable of storing all the data in a Gimp image. When you ask to save an image in a format that will not completely represent it, Gimp notifies you of this, tells you what kind of information will be lost, and asks you whether you would like to "export" the image in a form that the file type can handle. Exporting an image does not modify the image itself, so you do not lose anything by doing this.

[Note] Note
When you close an image (possibly by quitting Gimp), you are warned if the image is "dirty"; that is, if it has been changed without subsequently being saved. Saving an image in any file format will cause the image to be considered "not dirty", even if the file format does not represent all of the information from the image.