ImageMagick depends on a number of external resources including configuration files, loadable modules, fonts, and environment variables.
Configuration Files
ImageMagick depends on a number of external configuration files detailed here:
colors.xml
Associate a color name with its red, green, blue, and alpha intensities. Many command line options require a color parameter. It is often convenient to refer to a color by name (e.g. white) rather than by hex value (e.g. #fff).
configure.xml
Set ImageMagick build parameters and system-wide environment variables (e.g. MAGICK_TEMPORARY_PATH), including version, release date, delegate libraries, and quantum depth.
delegates.xml
Associate delegate programs with certain image formats, such as darktable for raw camera formats or Ghostscript for Postscript images.
Locale Files (english.xml, francais.xml, locale.xml)
Associate message tags (such as FileNotFound or MemoryAllocationFailed) with local translations. Currently available in English and French.
log.xml
Configure logging parameters. Control how informational or debugging statements appear and where they are posted.
mime.xml
Associate internet media types with unique identifiers and filename patterns (e.g. *.cdr) to quickly determine file formats or data streams.
policy.xml
Configure ImageMagick security policies to restrict coders, delegates, filters, or file paths, and set resource limits for multi-user servers.
Example Resource Limit Policies:
Memory, map, and disk arguments support SI prefixes (e.g. 100MB). Policies represent maximum limits per ImageMagick instance.
quantization-table.xml
Custom JPEG quantization tables. Activate with -define:q-table=quantization-table.xml.
thresholds.xml
Set threshold maps for ordered posterized dither.
type.xml
Configure font name, family, foundry, style, format, metrics, and glyphs.
type-ghostscript.xml
Configure Ghostscript fonts accessible within ImageMagick.
type-windows.xml
Associate names with Windows font glyphs.
Configuration File Search Order
Under Linux and Unix operating systems, ImageMagick searches directories in this order:
$PREFIX/etc/ImageMagick-7
$PREFIX/share/ImageMagick-7
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick
<client path>/etc/ImageMagick
For Linux pre-compiled uninstalled binary distributions:
$MAGICK_HOME/etc/ImageMagick-7
$MAGICK_HOME/share/ImageMagick-7
$PREFIX/share/ImageMagick-7
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick/
<client path>/etc/ImageMagick
<current directory>
Under Windows:
<windows registry>
$PREFIX/config
$USERPROFILE/.config/ImageMagick
<client path>
If a configuration file cannot be found, ImageMagick relies on built-in default values.
Modules
Coders
An image coder (encoder/decoder) manages a specific format (PNG, GIF, JPEG). Search order:
<client path>/../lib/ImageMagick-7.1.2/modules-Q16/coders
$MAGICK_HOME/share/ImageMagick-7.1.2/modules-Q16/coders
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick
<client path>/lib/ImageMagick-7.1.2/modules-Q16/coders
Filters
Custom image processing algorithm modules. Search order:
<client path>/../lib/ImageMagick-7.1.2/modules-Q16/filters
$MAGICK_HOME/share/ImageMagick-7.1.2/modules-Q16/filters
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick
<client path>/lib/ImageMagick-7.1.2/modules-Q16/filters
Fonts
ImageMagick loads raw TrueType and Postscript font files, searching for type.xml in this order:
$MAGICK_HOME/etc/ImageMagick-7.1.2
$MAGICK_HOME/share/ImageMagick-7.1.2
$XDG_CACHE_HOME/ImageMagick
$HOME/.config/ImageMagick
<client path>/etc/ImageMagick
$MAGICK_FONT_PATH
Environment Variables
Environment variables recognized by ImageMagick include:
| Variable | Description |
|---|---|
| HOME | Set path to search for configuration files in $HOME/.config/ImageMagick if the directory exists. |
| LD_LIBRARY_PATH | Set path to the ImageMagick shareable libraries and other dependent libraries. |
| MAGICK_AREA_LIMIT | Set maximum width * height of an image residing in pixel cache memory. Exceeding limits caches to disk. |
| MAGICK_FILTER_MODULE_PATH | Set search path when searching for filter process modules invoked via -process. |
| MAGICK_CODER_MODULE_PATH | Set path where ImageMagick locates coder modules to extend supported image formats. |
| MAGICK_CONFIGURE_PATH | Set path where ImageMagick locates configuration (.xml) files. Searched before defaults. |
| MAGICK_DATE_PRECISION | Set maximum number of characters printed for any timestamp. |
| MAGICK_DEBUG | Set debug options. See -debug for a description. |
| MAGICK_DISK_LIMIT | Set maximum amount of disk space in bytes permitted for use by the pixel cache. |
| MAGICK_ERRORMODE | Set process error mode (Windows only). |
| MAGICK_FILE_LIMIT | Set maximum number of open pixel cache files. |
| MAGICK_FONT_PATH | Set path searched for TrueType and Postscript Type1 font files. |
| MAGICK_HEIGHT_LIMIT | Set maximum height of an image. |
| MAGICK_HOME | Set top-level path of the ImageMagick installation directory for uninstalled builds. |
| MAGICK_LIST_LENGTH_LIMIT | Set maximum length of an image sequence. |
| MAGICK_MAP_LIMIT | Set maximum amount of memory map in bytes to allocate for the pixel cache. |
| MAGICK_MEMORY_LIMIT | Set maximum amount of heap memory in bytes to allocate for the pixel cache. |
| MAGICK_OCL_DEVICE | Set to off to disable hardware acceleration of accelerated algorithms. |
| MAGICK_PRECISION | Set maximum number of significant digits to be printed. |
| MAGICK_SHRED_PASSES | Overwrite temporary files with zeros or random data before removal. |
| MAGICK_SYNCHRONIZE | Set to "true" to ensure all image data is fully flushed and synchronized to disk. |
| MAGICK_TEMPORARY_PATH | Set path to store temporary files. |
| MAGICK_THREAD_LIMIT | Set maximum parallel threads for multi-processor systems. |
| MAGICK_THROTTLE_LIMIT | Periodically yield the CPU for at least the time specified in milliseconds. |
| MAGICK_TIME_LIMIT | Set maximum time in seconds before throwing an exception. |
| MAGICK_WIDTH_LIMIT | Set maximum width of an image. |
| SOURCE_DATE_EPOCH | UNIX timestamp defining seconds since 01 Jan 1970 00:00:00 UTC for pipeline builds. |
Define arguments for MAGICK_MEMORY_LIMIT, MAGICK_DISK_LIMIT, and MAGICK_MAP_LIMIT with SI prefixes (e.g. 100MB). MAGICK_WIDTH_LIMIT, MAGICK_HEIGHT_LIMIT, and MAGICK_AREA_LIMIT accept pixel suffixes such as MP for mega-pixels (e.g. 100MP). Limits can restrict security policies, but cannot relax them.