ImageMagick: Legacy | Image Formats (original) (raw)

ImageMagick uses an ASCII string known as convert (e.g. GIF) to identify file formats, algorithms acting as formats, built-in patterns, and embedded profile types. Support for some of the formats are delegated to libraries or external programs. The Installation Guide describes where to find these distributions and any special configuration options required.

To get a complete listing of which image formats are supported on your system, type

On some platforms, ImageMagick automagically processes these extensions: .gz for Zip compression, .Z for Linux compression, .bz2 for block compression, and .pgp for PGP encryption. For example, a PNM image called image.pnm.gz is automagically uncompressed.

A majority of the image formats assume an sRGB colorspace (e.g. JPEG, PNG, etc.). A few support only linear RGB (e.g. EXR, DPX, CIN, HDR) or only linear GRAY (e.g. PGM). A few formats support CMYK. Then there is the occasional format that also supports LAB (that is CieLAB) (e.g. TIFF, PSD, JPG, JP2). To determine the colorspace of your image, use this command:

When processing an image, be aware of the colorspace. Many image processing algorithms assume a linear RGB colorspace. Although you may get satisfactory results processing in the sRGB colorspace, you may get improved results in linear RGB (essentially sRGB with the gamma function removed). For example,

As of IM 6.7.8-2 one can properly work in LAB colorspace whether or not Imagemagick is HDRI-enabled. Essentially the A and B channels are stored with a 50% gray bias, to allow it to handle the negatives required by the format.

Again, it may not make sense for some image processing operators to work directly in LAB space, but ImageMagick permits it and generally returns reasonable results.

ImageMagick supports reading over 100 major file formats (not including sub-formats). The following table provides a summary of the supported image formats.

ImageMagick supports a number of image format specifications which refer to images prepared via an algorithm, or input/output targets. The following table lists these pseudo-image formats:

ImageMagick includes a number of built-in (embedded) images which may be referenced as if they were an image file. The convert: format tag may be used via the syntax magick:name to request an embedded image (e.g. magick:logo). For backwards compatibility, the image specifications GRANITE:, LOGO:, NETSCAPE:, and ROSE: may also be used to request images with those names.

ImageMagick includes a number of built-in (embedded) patterns which may be referenced as if they were an image file. The pattern: format tag may be used via the syntax pattern:name to request an embedded pattern (e.g. pattern:checkerboard). The pattern size is controlled with the -size command line option.

ImageMagick provides a number of format identifiers which are used to add, remove, and save embedded profiles for images which can support embedded profiles. Image types which may contain embedded profiles are TIFF, JPEG, and PDF.