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.
The Fx special effects image operator is used to apply a mathematical expression to an image or image channels.
$cmd = "$input -fx \"(1.0/(1.0+exp(10.0*(0.5-u)))-0.006693)*1.0092503\" "; exec("convert $cmd fx.jpg");
Blur the image with a Gaussian operator.
$cmd = "$input -gaussian-blur 0x4 "; exec("convert $cmd gaussian-blur.jpg");
Geometry sets the coordinates for the modification.
$cmd = "$input -fill white -pointsize 40". " -gravity center -geometry +30+30 -annotate +0+0 \"Geometry\" "; exec("convert $cmd geometry.jpg");
( If -gravity is used as well it is in relation to the gravity position otherwise it is from the top left corner. )
Gravity sets the location of the modification.
$cmd = "$input -gravity north -annotate +0+0 \"North\" "; exec("convert $cmd gravity.jpg");
( Points of the compass are used e.g. North, North west, West etc. )
Convert image to grayscale.
$cmd = "$input -grayscale Rec709Luminance "; exec("convert $cmd grayscale.jpg");
Green chromaticity primary point.
More information to follow.( For each color, x+y must be positive and less than 1.0. If you specify one you should specify all six plus the white_point x and y. )
Apply a Hald color lookup table to the image.
$cmd = "$input $input5 -hald-clut"; exec("convert $cmd hald_clut.jpg");
Display the help file
-adjoin join images into a single multi-image file( A couple of lines from the help file )
When comparing images, emphasize pixel differences with this color.
More information to follow.Identify the format and characteristics of the image.
input.jpg=>-identify JPEGsystem("convert $input -identify ");
( More information can be desplayed by adding -verbose )