Rubblewebs

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.

Imagemagick operators page 17

Shear

Shear the image along the x-axis and/or y-axis.

Shear example

$cmd = "$input -background NavajoWhite -shear 15x15"; 
exec("convert $cmd shear.jpg");

( The colour of the parts of the canvas exposed by the image moving are set by -background. )

Sigmoidal contrast

Increase the contrast without saturating highlights or shadows.

Sigmoidal contrast example

$cmd = "$input -sigmoidal-contrast \"3x20%\" "; 
exec("convert $cmd sigmoidal_contrast.jpg");

Silent

Operate silently.

More information to follow.

Similarity threshold

Minimum RMSE for subimage match.

Another Similarity threshold example


( Used with compare )

Size

Set the width and height of the image.

Size example

 
$cmd = "-size 213x160 xc:NavajoWhite -stroke black ".   
"-strokewidth 1 -fill none -draw \"circle 106,80 106,10 \" ";   
exec("convert $cmd size.jpg"); 

Sketch

Simulate a pencil sketch.

Sketch example

$cmd = "$input -colorspace gray -sketch 0x10+135"; 
exec("convert $cmd sketch_simple.jpg");

Smush

It does more than just append with a overlap. It appends images with shape, and allowing one shape to fit into another shape.

Smush example

convert -pointsize 72 -background none \
-fill red label:A -fill blue label:V \
+smush 0 av_smush.png

Snaps

Set the number of screen snapshots.

Not used with php.

Solarize

Negate all pixels above the threshold level.

Solarize example

$cmd = "$input -solarize \"40%\" "; 
exec("convert $cmd solarize_percent.jpg");

( Effect using percent. )

Sparse color

Color the given image using the specified points of color, and filling the other intervening colors using the given methods.

Sparse color example

$cmd = "-size 100x100 xc: -sparse-color  Voronoi ". 
" \"30,10 red 10,80 blue 70,60 lime 80,20 yellow\" ". 
"-fill white -stroke black ". 
"-draw \"circle 30,10 30,12 circle 10,80 10,82\" ". 
"-draw \"circle 70,60 70,62 circle 80,20 80,22\" "; 
exec("convert $cmd sparse_voronoi.gif");

Splice

Splice the current background color into the image.

Splice example

$cmd = "$input -background NavajoWhite -splice 20x20+133+100"; 
exec("convert $cmd splice.jpg");

Spread

Displace image pixels by a random amount.

Spread example

$cmd = "$input -spread 10 "; 
exec("convert $cmd spread.jpg");

Stegano

Hide watermark within an image.

Stegano example

Another Stegano example

// Create the message and imbed it into the image
$cmd = " -size 150x40 xc:white -fill black -pointsize 20 ".
" -gravity center -annotate +0+0 \"Secret message\" miff:- | composite ".
" - $input1 -stegano +15+2 message.png";  
exec("convert $cmd message.png");  

// Recover the message
$cmd = "-size 150x40+15+2 stegano:message.png";
exec("convert $cmd stegano.gif");

( If image is modified in anyway the watermark can not be recovered; hence the image needs saving in a format that does not get compressed on saving e.g. png )

Stereo

Composite two images to create a stereo anaglyph.

More information to follow.