These are the kinds of image files supported by the PIL.
The first column gives the PIL file type code, as used in
the Image.format attribute and the Image.save() method (although not all types can be
saved). The second column shows the file extensions
associated with that type. The next two columns show which
modes can be read (if any) and written (if any), or the
word “None” if that file type cannot be read
or written.
| Type | Extensions | Read modes | Write modes | Remarks |
|---|---|---|---|---|
"BMP" | .bmp .dib | 1 L P RGB | 1 L P RGB | |
"DCX" | .dcx | 1 L P RGB | None | Fax format. Only the first image is read. |
"EPS" | .eps .ps | None | L RGB | Encapsulated PostScript |
"GIF" | .gif | P | P | |
"IM" | .im | All | All | Used by LabEye and other applications. |
"JPEG" | .jpg .jpe .jpeg | L RGB CMYK | L RGB CMYK | |
"PCD" | .pcd | RGB | None | Photo CD format; will read the 768x512 resolution. |
"PCX" | .pcx | 1 L P RGB | 1 L P RGB | |
"PDF" | .pdf | None | 1 RGB | Adobe Page Description Format. |
"PNG" | .png | 1 L P RGB RGBA | 1 L P RGB RGBA | Portable Network Graphics format. |
"PPM" | .pbm .pgm .ppm | 1 L RGB | 1 L RGB | |
"PSD" | .psd | P | None | Photoshop format. |
"TIFF" | .tif .tiff | 1 L RGB CMYK | 1 L RGB CMYK | |
"XBM" | .xbm | 1 | 1 | X bitmap files. |
"XPM" | .xpm | P | P | X pixmap files with up to 256 colors. |
This table includes only some of the more common image formats. Refer to the online documentation for a full list.