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.
Set scene number.
More information to follow./* convert '*.jpg' -resize 256 -scene 1 image_%02d.jpg */
( Resize all the jpg files in a folder and start saving them with the number 1 rather than the default of 0 )
Stop the processing of command line arguments as image operations, and read all further options from the given file or pipeline.
Segment the colors of an image.
$cmd = "$input -segment 60x0.5 "; exec("convert $cmd segment.jpg");
Selectively blur pixels within a contrast threshold.
$cmd = " $input -selective-blur 0x6+09% "; exec("convert $cmd selective_blur.jpg");
Separate an image channel into a grayscale image.
$cmd = " $input -channel RGB -separate "; exec ("convert $cmd separate.png");
( Specify the channel with -channel. )
Set an image attribute for all images in the current image sequence, after they have been created or read in.
More information to follow.Shade the image using a distant light source.
// Create the text $cmd = "-size 215x68 xc:none -pointsize 25 -fill white ". " -gravity northwest -annotate +15+10 Boots ". " -gravity southeast -annotate +10+0 Boots -shade 240x40"; exec("convert $cmd tmp_font.png "); // Create the gradiant exec("convert -size 213x160 gradient:pink-red tmp_gradient.png"); // Put the text over the gradiant exec("composite -watermark 40% -tile tmp_font.png tmp_gradient.png watermark.png"); // Put the image over the watermarked gradiant exec("convert watermark.png $input1 -gravity center -composite shade.jpg");
Simulate an image shadow.
$cmd = "$input ( +clone -background black -shadow 80x4+5+5 )". " +swap -background none -layers merge +repage "; exec("convert $cmd shadow.png");
( To retain the transparency of the shadow save as a png. )
Shave pixels from the image edges.
$cmd = "$input -shave 40x20"; exec("convert $cmd shave.jpg");