ImageMagick v6.8.7-3 - Training Material | WP3

Author: Sebastian Kirch (IAIS)

Tool Description ImageMagick is a software suite to create, edit, compose, or bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is delivered as a ready-to-run binary distribution or as that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license.

Scanned document images often need to be optimized in order to enhance their contrast or to scale them to a certain size. This step is usually part of the post-processing workflow where images are prepared for visual presentation or they are analyzed using OCR and text processing software. By integrating image manipulation software such as ImageMagick into the post- processing workflow, images can be automatically enhanced using all the operations and features that the software has to offer. They can be resized, optimized or otherwise edited in one single step without any manual intervention.

System Requirements Windows, , Mac OS X, iOS Hardware Dependencies - Software Dependencies - Non-technical Requirements ImageMagick does not have a (GUI) and therefore requires some basic knowledge on how to use and execute the command-line programs.

Installation Files Binary releases can be downloaded from the ImageMagick website at http://www.imagemagick.org/script/binary-releases.php.

Installation Instructions Installation instructions are available for Unix, Mac OS X, iOS and Windows systems. Please refer to http://www.imagemagick.org/script/binary-releases.php for detailed instructions.

Quick Start Guide ImageMagick includes several command-line tools which serve different purposes. A short overview is given on the ImageMagick Website (http://www.imagemagick.org/script/command- line-tools.php). The most relevant tool for image enhancement however is the “convert”

Succeed is supported by the European Union under FP7­ICT and coordinated by Universidad de Alicante. ImageMagick v6.8.7-3 - Training Material, version 1.1, Page 2/3 09/01/2014

executable. This tool allows you to convert between image formats as well as resize an image, blur, crop, despeckle, , draw on, flip, join, re-sample, and much more. Examples on how to use the tool can be found at http://www.imagemagick.org/script/convert.php or in the “Examples” section. To get started with ImageMagick just take a look at the other examples provided in the usage section of the ImageMagick website (http://www.imagemagick.org/Usage/) or the command-line tool documentation (http://www.imagemagick.org/script/command-line-tools.php).

Documentation Configuration and Customization ImageMagick can be configured using command-line parameters. Please refer to the ImageMagick website at http://www.imagemagick.org/script/command-line-tools.php and choose one of the available command-line tools for a complete list of the possible parameters.

Additionally, ImageMagick offers the ability to perform custom image processing tasks from a script written in the Magick Scripting Language (MSL)1:

“MSL is XML-based and consists of action statements with attributes. Actions include reading an image, processing an image, getting attributes from an image, writing an image, and more.”

A short example can be found in the “Examples” section.

Workflow Integration ImageMagick can be integrated into any workflow or application that allows the execution of command-line tools. See section “Configuration” for details on how the tool can be configured using parameters.

Examples

1) Convert Resizing an image to 50% of its original size while converting it from JPEG to PNG can be achieved with the following command:

convert input.jpg -resize 50% output.png

2) Conjure This simple MSL-example from the ImageMagick Website resizes a given image to 400x400 pixels:

It can be executed using the following command:

conjure -dimensions 400x400 incantation.msl

For more examples on how to use ImageMagick, please refer to http://www.imagemagick.org/Usage/.

Licensing ImageMagick is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).

Succeed is supported by the European Union under FP7­ICT and coordinated by Universidad de Alicante.