Next / Previous / Contents / TCC Help System / NM Tech homepage

8. Supported file formats

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.

TypeExtensionsRead modesWrite modesRemarks
"BMP".bmp .dib1 L P RGB1 L P RGB 
"DCX".dcx1 L P RGBNoneFax format. Only the first image is read.
"EPS".eps .psNoneL RGBEncapsulated PostScript
"GIF".gifPP 
"IM".imAllAllUsed by LabEye and other applications.
"JPEG".jpg .jpe .jpegL RGB CMYKL RGB CMYK 
"PCD".pcdRGBNonePhoto CD format; will read the 768x512 resolution.
"PCX".pcx1 L P RGB1 L P RGB 
"PDF".pdfNone1 RGBAdobe Page Description Format.
"PNG".png1 L P RGB RGBA1 L P RGB RGBAPortable Network Graphics format.
"PPM".pbm .pgm .ppm1 L RGB1 L RGB 
"PSD".psdPNonePhotoshop format.
"TIFF".tif .tiff1 L RGB CMYK1 L RGB CMYK 
"XBM".xbm11X bitmap files.
"XPM".xpmPPX 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.