39.17.1 Image Formats
Emacs can display a number of different image formats. Some of these image formats are supported only if particular support libraries are installed. On some platforms, Emacs can load support libraries on demand; if so, the variable dynamic-library-alist
can be used to modify the set of known names for these dynamic libraries. See Dynamic Libraries.
Supported image formats (and the required support libraries) include PBM and XBM (which do not depend on support libraries and are always available), XPM (libXpm
), GIF (libgif
or libungif
), JPEG (libjpeg
), TIFF (libtiff
), PNG (libpng
), and SVG (librsvg
).
Each of these image formats is associated with an image type symbol. The symbols for the above formats are, respectively, pbm
, xbm
, xpm
, gif
, jpeg
, tiff
, png
, and svg
.
Furthermore, if you build Emacs with ImageMagick (libMagickWand
) support, Emacs can display any image format that ImageMagick can. See ImageMagick Images. All images displayed via ImageMagick have type symbol imagemagick
.
variable
image-types​
This variable contains a list of type symbols for image formats which are potentially supported in the current configuration.
“Potentially" means that Emacs knows about the image types, not necessarily that they can be used (for example, they could depend on unavailable dynamic libraries). To know which image types are really available, use image-type-available-p
.
function
image-type-available-p type​
This function returns non-nil
if images of type type
can be loaded and displayed. type
must be an image type symbol.
For image types whose support libraries are statically linked, this function always returns t
. For image types whose support libraries are dynamically loaded, it returns t
if the library could be loaded and nil
otherwise.