ImageMagick

ImageMagick is an external program that can be called from php and in the following pages you can find some
examples, tips and tricks on how to use it with php.

There are APIs to use ImageMagick but I tend to use the php exec() function along with the command line method
as I find it gives more flexability.

I have also included a few examples of the GD library that is built into php and one of the php APIs called Imagick
which is also built into the later versions of php.

Do not confuse Imagick with ImageMagick !

Basics

Colours available
Command path
Fonts available
Imagemagick version
Image information
Detailed setup information
What is ImageMagick?
What is Imagick?
Windows Batch files
Some basic installation instructions
Installation information for Linux/Unix
Installation information for Mac
Installation information for Windows
Installation information for XAMPP on a windows PC
Examples of how to write ImageMagick code

Examples

Overlaid image
Watermark
Overlapped photos
Artistic modifications
Distort examples
Draw examples
Some montage option examples
Other examples
Text examples
PSD notes
Resize examples including crop
Watermarking examples
Improving a photos colours and contrast
Resize and filters
A working example
Some simple GD example code

Code

Imagemap example
Create thumbnails of all the images in a directory
Create film strip effect of all the images in a directory
Add an effect to an image on its upload
Add a text watermark to an image on its upload
Resize an image on upload
Watermark multiple images on upload

Compare

Some comparisons between
ImageMagick and GD

Information

Colours
Display the image without saving it
Displaying errors
Font styling
Gravity
How to format the code
Print size
Save an image property into a variable
Useful information
Variables
Wordwrap
Shell bash example
Some speed tests
How to avoid tempory images
Display the debug information
Useful links

THESE CODES ARE PROVIDED FOR AN EXAMPLE
OF HOW TO USE IMAGEMAGICK WITH PHP.
CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.

I TAKE NO RESPONSABILTY FOR ANY PROBLEMS
THAT MAY OCCURE WHEN USING ANY OF THIS CODE.

IT IS UP TO YOU TO SECURE THE CODE AND
VALIDATE USER INPUT.