Book Image

ImageMagick Tricks

By : Sohail Salehi
Book Image

ImageMagick Tricks

By: Sohail Salehi

Overview of this book

<p>The book is packed with interesting and fun examples. We had a lot of fun coming up with cool ways to demonstrate ImageMagick's power, and we're sure you'll have fun learning how to create them.<br /><br />Although the printed book is in black and white, there is a full colour PDF of the screenshots freely available that includes all of the images in the book. Use it to see exactly what the ImageMagick effects look like in colour, or browse through it and see just what you'll learn to do with this book.<br /><br />ImageMagick is a free software suite to create, edit, and compose bitmap images using text-based commands. The commands can be issued from the command line, but more often will be included in web or desktop applications &acirc;&euro;&ldquo; carrying out complex image-manipulation tasks in response to the user's input.<br /><br />ImageMagick is a popular way for generating images on-the-fly in web pages, whether it's generating thumbnails from a large image, or creating complex combinations of images, text, and effects chosen by a visitor or the web site's creator.</p>
Table of Contents (18 chapters)
ImageMagick Tricks
Credits
About the Author
About the Reviewers
Preface
5
Identify, Display, and Import
Index

Conjure Syntax and Options


Conjure uses the following syntax:

conjure [options]script.msl [[options]script.msl]

The script.msl file is an XML file that contains elements that instruct ImageMagick to do special tasks.

For example, in the following code we convert an image from JPEG to TIFF:

<?xml version="1.0" encoding="UTF-8"?>
<image>
<read filename="test.jpg" />
<write filename="test.tif" />
<print output="Image format converted from JPEG to TIFF" />
</image>

Write this code in your favorite text editor, save it as test.msl, and see it in action when you invoke it using the conjure utility as follows:

conjure test.msl

If you notice the conjure usage notation, there are some options in the command. In fact, these options perform the same task as the options in the batch files.

Fig 7-2: Diagram Showing Data Replacement of conjure Options in a .msl File

In a batch file execution we can define some external parameters and values that will be used by the...