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

Preface

ImageMagick ™ was introduced in 1999 by ImageMagick Studio LLC for the first time. It is a graphical application used for performing image processing tasks. It is a powerful collection of tools and libraries to read, write, and manipulate images in about 100 formats.

In this book, I'll show how to use the various ImageMagick utilities to create amazing artwork from the command line. You may find doing some image processing tasks with this program is more convenient than using other solutions, like Adobe Photoshop.

Let me give you an example. How do you resize about 3000 photos of different sizes and formats and place a watermark on them? This question led me to examine ImageMagick for the first time and after a while I found it to be a powerful and easy to learn application.

You may not believe how easily ImageMagick can do it for you. With a single command you can resize, watermark, add effects, frame, arrange, convert, format, and do many more tasks on a single image or a bunch of various images.

To cut a long story short, I think it is the best command-line image processing application that I’ve ever seen. It is more than a command-line application. If you are a programmer using compilers like C, Delphi, Python, Perl, and so on or even server-side languages like PHP, then you can find your favourite ImageMagick API for your compiler.

Due to space limitaion, this book concentrates just on command-line utilities. Maybe in the future we will publish titles on other ImageMagick APIs.

What This Book Covers

Chapter 1 is an introduction, which provides you with a brief history about Imagemagick and its capabilities.

Chapter 2 contains useful steps for installing and configuring ImageMagick. There are some good resources for downloading the application—based on your OS—too.

Chapter 3 covers the convert and mogrify utilities. You can find practical workshops in this chapter.

Chapter 4 covers the composite and montage utilities and their role in combining and presenting images.

Chapter 5 mainly focuses on input (import utility) and output (display utility) in ImageMagick. There are some descriptions about obtaining useful information from images using identify.

Chapter 6 teaches you how to create animations using ImageMagick.

Chapter 7 contains brief information about the ImageMagick command line programming language—conjure. Moreover in this chapter the compare utility, which compares the differences between two images of the same size, visually and mathematically will be studied too.

Chapters 8, 9, and 10 cover some practical web projects including building a confirmation-code box, online customized e-cards, and online customized templates (for a book cover).

Appendix A will show you how to install and use new fonts. There are some free resources for fonts and images too.

Appendix B covers the compression and quality trade-off in ImageMagick.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

There are three styles for code. Code words in text are shown as follows: "We can include other contexts through the use of the include directive."

A block of code will be set as follows:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be made bold:

[default]
exten => s,1,Dial(Zap/1|30)
exten => s,2,Voicemail(u100)
exten => s,102,Voicemail(b100)
exten => i,1,Voicemail(s0)

Any command-line input and output is written as follows:

convert rectangles.jpg resize 900% rect_resized.jpg

New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader Feedback

Feedback from our readers is always welcome. Let us know what you think about this book, what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to , making sure to mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer Support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the Example Code for the Book

Visit http://www.packtpub.com/support, and select this book from the list of titles to download any example code or extra resources for this book. The files available for download will then be displayed.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing this you can save other readers from frustration, and help to improve subsequent versions of this book. If you find any errata, report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the Submit Errata link, and entering the details of your errata. Once your errata have been verified, your submission will be accepted and the errata added to the list of existing errata. The existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Questions

You can contact us at if you are having a problem with some aspect of the book, and we will do our best to address it.