EFFECTS

This tutorial covers some some enhancement functions using PHP with Image Magick from the command line. The majority of these scripts use a (radius)x(sigma) parameter. As a general rule the radius should be 3 times the sigma. If the radius is set to 0, then Image Magick will configure the appropriate radius for the sigma value.
-spread pixel
<?
$IN="SGlion.jpg";
$EFFECT="-spread 3";
$OUT="SGlionSpread.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
SPREAD
-sharpen radius x sigma
<?
$IN="SGpattern.jpg";
$EFFECT="-sharpen 30x10";
$OUT="SGpatSrp.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
SHARPEN
-edge radius
<?
$IN="SGind.jpg";
$EFFECT="-edge 2";
$OUT="SGindedge.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
EDGE
-emboss radius x sigma
<?
$IN="SGflake.jpg";
$EFFECT="-emboss 0x1";
$OUT="SGflakeemb.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
EMBOSS
-blur radius x sigma
<?
$IN="SGstar.jpg";
$EFFECT="-blur 0x3";
$OUT="SGstarblur.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
BLUR
-gaussian radius x sigma
<?
$IN="SGflake.jpg";
$EFFECT="-gaussian 0x3";
$OUT="SGflakegaus.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
GAUSSIAN
-radial-blur radius x sigma
<?php
$IN="SGflake.jpg";
$EFFECT="-radial-blur 0x20";
$OUT="SGflakerb.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
RADIAL BLUR
-median radius
<?php
$IN="SGflake.jpg";
$EFFECT="-median 18";
$OUT="SGflakemed.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MEDIAN FILTER
-adaptive-blur radius x sigma
<?php
$IN="SGflake.jpg";
$EFFECT="-adaptive-blur 0x20";
$OUT="SGflakeadb.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
ADAPTIVE BLUR
-motion blur radius x sigma +angle
<?php
$IN="SGstar.jpg";
$EFFECT="-motion-blur 0x10+45";
$OUT="SGstarmb45.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MOTION BLUR
ANGLE 45
<?php
$IN="SGstar.jpg";
$EFFECT="-motion-blur 0x10+90";
$OUT="SGstarmb90.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MOTION BLUR
ANGLE 90
<?php
$IN="SGstar.jpg";
$EFFECT="-motion-blur 0x10+180";
$OUT="SGstarmb180.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MOTION BLUR
ANGLE 180
<?php
$IN="SGstar.jpg";
$EFFECT="-motion-blur 0x10+270";
$OUT="SGstarmb270.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MOTION BLUR
ANGLE 270
<?php
$IN="SGstar.jpg";
$EFFECT="-motion-blur 0x10+360";
$OUT="SGstarmb360.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
MOTION BLUR
ANGLE 360
-black-threshold percent(below % = black above unchanged)
<?php
$IN="SGfish.jpg";
$EFFECT="-black-threshold 45%";
$OUT="SGfishbt.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
BLACK THRESHOLD
-white-threshold percent (above % = white, below unchanged)
<?php
$IN="SGfish.jpg";
$EFFECT="-white-threshold 45%";
$OUT="SGfishwt.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
WHITE THRESHOLD
<?php
$IN="Examples/SGfishmod.jpg";
$EFFECT="-black-threshold 45%";
$OUT="SGfishgbt.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
BLACK THRESHOLD
<?php
$IN="Examples/SGfishmod.jpg";
$EFFECT="-white-threshold 45%";
$OUT="SGfishgwt.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
WHITE THRESHOLD
-sharpen radius x sigma
<?php
$IN="SGfish.jpg";
$EFFECT="-sharpen 0x20";
$OUT="SGfishsharp.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
SHARPEN
-adaptive-sharpen radius x sigma
<?php
$IN="SGfish.jpg";
$EFFECT="-adaptive-sharpen 15x5";
$OUT="SGfishadsharp.jpg";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
ADAPTIVE SHARPEN
-shadow percent-opacity{xsigma}{+-}x{+-}y{offset}
<?
$IN="SGfish.gif";
$EFFECT="-shadow 60x5+10+10";
$OUT="SGfishshadow.gif";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
ORIGINAL
SHADOW
<?
$IN="SGfish.gif";
$EFFECT="\( +clone -background navy -shadow 60x5+10+10 \) +swap -background none -mosaic";
$OUT="SGfishshad.gif";
exec ("/usr/bin/convert $IN $EFFECT $OUT");
?>
Put together
Use a gif
SHADOW
Shadow offset at 100x5+10+10
PAGE 2


Below are a zip of a sample effects script plus an effects form and a channel threshold form. There is also a text version of the form if you prefer that to the zip.

EFFECTS ZIP

EFFECTS TEXT

CHANNEL THRESHOLD TEXT