Distort options page 1

Affine
Distort the image linearly by moving a list of at least 3 or more sets of control points
Row title = affine.png
ResizeAffine example
<?php 
$cmd 
$input -virtual-pixel transparent -distort Affine \"0,0 30,30   100,0 150,0   213,160 213,140\" ";
exec("convert $cmd affine.png");
  
?>
Affine projection
Linearly distort an image using the given Affine Matrix of 6 pre-calculated coefficients
Row title = No image available
More information to follow.

<?php 
$cmd 
$input -matte -virtual-pixel Transparent ".
" +distort AffineProjection \"1,.006,0,1,0,0\" +repage ";
exec("convert $cmd AffineProjection.png");
 
?>
Arc
Arc the image (variation of polar mapping) over the angle given around a circle.
Row title = arc.png
ResizeArc example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent -distort arc 180"
exec("convert $cmd arc.png");
  
?>
Barrel
Given the four coefficients (A,B,C,D) as defined by Helmut Dersch, perform a barrel or pin-cushion distortion appropriate to correct radial lens distortions.
Row title = barrel.png
ResizeBarrel example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent"
" -distort barrel \" 0.0 0.2 0.0 1.0 \" -trim"
exec("convert $cmd barrel.png");
  
?>
Barrel Inverse
This is very similar to 'Barrel' with the same set of arguments, and argument handling. However it uses the inverse of the radial polynomial.
Row title = No image available
More information to follow.

<?php 
$cmd 
"$input -matte -virtual-pixel transparent"
" -distort BarrelInverse \" 0.0 0.0 -0.2 1.0 \" -trim"
exec("convert $cmd barrelInverse.png");
 
?>
Bilinear forward
Bilinear Distortion, given a minimum of 4 sets of coordinate pairs, or 16 values.
Row title = bilinearforward.png
ResizeBilinear forward example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent ".
" -interpolate Spline ".
" -distort BilinearForward \"0,0 20,0   213,0 180,30   213,160 213,130   0,160 0,140\" ";  
exec("convert $cmd bilinearforward.png");
  
?>
Bilinear reverse
Bilinear Distortion, given a minimum of 4 sets of coordinate pairs, or 16 values.
Row title = bilinearreverse.png
ResizeBilinear reverse example
<?php 
$cmd 
" bilinearforward.png -matte -virtual-pixel black ".
" -distort BilinearForward \"20,0 0,0   180,30 213,0   213,130 213,160   0,140 0,160\" ";
exec("convert $cmd bilinearreverse.png");
 
?>


( Reversing the Bilinear forward effect. )
DePolar
Uses the same arguments and meanings as a 'Polar' distortion but generates the reverse Polar to Cartesian distortion.
Row title = depolar.png
ResizeDePolar example
<?php 
$cmd 
"polar.png -matte -virtual-pixel transparent".  
" -distort depolar \"100,20 133,100 180,270\" ";  
exec("convert $cmd depolar.png");
  
 
?>


( Opposite effect to polar. )
Perspective
Perspective distort the images, using a list of 4 or more sets of control points.
Row title = perspective.png
ResizePerspective example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent"
" -distort Perspective \"0,0 0,0   213,0 213,20   213,160 213,140   0,160 0,160 \" "
exec("convert $cmd perspective.png");
  
?>


( The later control points are in a different order to the earlier versions. )
PerspectiveProjection
Do a 'Perspective' distortion biased on a set of 8 pre-calculated coefficients.
Row title = No image available
More information to follow.

<?php 
$cmd 
"$input -alpha set -virtual-pixel transparent ".
" -distort Perspective-Projection \"1.40, 0.25, 3.0    0.15, 1.30, 0.0    0.007, 0.009' \" ";
exec("convert $cmd Perspective_Projection.png");
   
?>
Polar
Like 'Arc' but do a complete Cartesian to Polar mapping of the image.
Row title = polar.png
ResizePolar example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent"
" -distort polar \"100,20 133,100 180,270\" "
exec("convert $cmd polar.png");
  
?>
Scale rotate translate
Distort image by first scaling and rotating about a given 'center', before translating that 'center' to the new location, in that order.
Row title = srt.png
ResizeScale rotate translate example
<?php 
$cmd 
$input -matte -virtual-pixel transparent ".
" -distort ScaleRotateTranslate \"28,24  .4,.8  -110  50,120 \" ";
exec("convert $cmd srt.png");
 
?>


( Also known as SRT )
Shepards
Distort the given list control points (any number) using an Inverse Squared Distance Interpolation Method.
Row title = shepards.png
ResizeShepards example
<?php 
$cmd 
"$input -matte -virtual-pixel transparent"
" -distort Shepards \"0,0 0,0  0,100 20,100 0,200"
" 0,200 133,200 133,180 266,200 266,200 266,100"
" 246,100 266,0 266,0 133,0 133,20\" "
exec("convert $cmd shepards.png");
 
?>