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

Wizard Step 2: How to Write Text on Input Images


We saw that the images in the web gallery have various predefined settings for writing text on them, but what about other images?

So we need a page to define new charactristics for fonts that we are going to use on the image text. step2.php contains several parts for defining these settings and a unique naming mechanism for files. As we saw in the earlier discussions in this chapter we can create unique file names using user session IDs.

The first problem is to obtain the overall properties of the image that is addressed or uploaded. We have no idea about the format and size of the image that the user is going to work on and hence it is necessary to get information like:

  • What is the image dimension?

  • How long is the text (after font specifications are defined) that the user is going to write?

  • How big is the area the user is going to write the text on?

When the user knows the image dimensions, then he or she has better estimation about what portion...