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.
Output to STDERR a measure of the differences between images according to the type given metric.
8.11889system("compare -metric PSNR monochrome.jpg emboss.jpg difference.png 2>&1");
Vary the brightness, saturation, and hue of an image.
$cmd= "$input -modulate 125,75,100"; exec("convert $cmd modulate.jpg");
Report image moments.
system(" identify $input -moments");
( Used with identify.
Rubblewebs\imagemagick\operators\images\input.jpg JPEG 213x160 213x160+0+0 8-bit sRGB 34.9KB 0.000u 0:00.000 )
Transform the image to black and white.
$cmd = "$input -monochrome "; exec("convert $cmd monochrome.jpg");
Morphs an image sequence.
$cmd = "$input hald_clut.jpg colorspace.jpg -morph 20"; exec("convert $cmd morph.gif");
( File sizes can get quite large. )
apply a morphology method to the image.
Replace every pixel with its complementary color.
$cmd = "$input -negate "; exec("convert $cmd negate.jpg");
Increase the contrast in an image by stretching the range of intensity values.
$cmd = "$input -normalize "; exec("convert $cmd normalize.jpg");