This tutorial covers some transformation functions using PHP with Image Magick from the command line. | |||||||||||||||||||||
| |||||||||||||||||||||
ORIGINAL IMAGE | |||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-flop"; $OUT="papercutflop.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | FLOP | ||||||||||||||||||||
lt;? $IN="papercut.jpg"; $TRANSFORM="-flip"; $OUT="papercutflip.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | FLIP | ||||||||||||||||||||
lt;? $IN="papercut.jpg"; $TRANSFORM="-transpose"; $OUT="papercuttransp.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | TRANSPOSE | ||||||||||||||||||||
lt;? $IN="papercut.jpg"; $TRANSFORM="-transverse"; $OUT="papercuttransv.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | TRANSVERSE | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-background '#997766' -rotate 30"; $OUT="papercutrotate30.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | ROTATE | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-roll +0+30"; $OUT="papercutrollV.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT");?> ?> | ROLL VERTICALLY | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-roll +50+0"; $OUT="papercutrollH.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT");?> ?> | ROLL HORIZONTALLY | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-roll +50+30"; $OUT="papercutrollHV.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT");?> ?> | ROLL H AND V | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-background '#997766' -shear 0x50"; $OUT="papercutshearV.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | SHEAR VERTICALLY | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-background '#997766' -shear 50x0"; $OUT="papercutshearH.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | SHEAR HORIZONTALLY | ||||||||||||||||||||
<? $IN="papercut.jpg"; $TRANSFORM="-background '#997766' -splice 10x10+50+75"; $OUT="papercutsplice.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | SPLICE | ||||||||||||||||||||
<?php $IN="papercut.jpg"; $TRANSFORM="-background '#663300' -splice 30x30+0+0"; $OUT="papercutsplicelt.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | SPLICE ADD HALF BORDER | ||||||||||||||||||||
<?php $IN="Examples/papercutsplicelt.jpg"; $OUT="papercutshavelt.jpg"; exec ("/usr/bin/convert $IN $TRANSFORM $OUT"); ?> | SHAVE | ||||||||||||||||||||