Imagick distort functions page 1

Affine
Distort the image linearly by moving a list of at least 3 or more sets of control points.
No example

Affine projection
Linearly distort an image using the given Affine Matrix of 6 pre-calculated coefficients.
No example

Arc
Arc the image.
Arc example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input ); 
$distort = array( 180.00.0 );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_ARC$distortTRUE ); 
$im->writeImage('distort_arc.png'); 
$im->destroy();
 
?>
Barrel
Given the four coefficients (A,B,C,D) as defined by Helmut Dersch, perform a barrel or pin-cushion distortion.
Barrel example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input );
$distort = array( 0.00.20.01.0  );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_BARREL$distortTRUE ); 
$im->writeImage('distort_barrel.png'); 
$im->destroy();
 
?>
Barrel inverse
This is very similar to 'Barrel' with the same set of arguments, and argument handling.
Barrel inverse example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick'distort_bilinear.png' );
$distort = array( 0.00.20.01.0  );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_BARRELINVERSE$distortTRUE ); 
$im->writeImage('distort_barrelinverse.png'); 
$im->destroy();
 
?>
Bilinear
Bilinear Distortion, given a minimum of 4 sets of coordinate pairs, or 16 values.
Bilinear example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input );
$distort = array( 0,020,0,   213,0180,30,   213,160213,130,   0,1600,140  );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_BILINEAR$distortTRUE ); 
$im->writeImage('distort_bilinear.png'); 
$im->destroy();
 
?>
Depolar
Uses the same arguments and meanings as a 'Polar' distortion but generates the reverse.
Depolar example
Perspective
Perspective distort the images, using a list of 4 or more sets of control points.
Perspective example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input ); 
$corners = array( 0,00,0200,0200,30200,150200,1200,1500,150 );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_PERSPECTIVE$cornersTRUE ); 
$im->writeImage('distort_perspective.png'); 
$im->destroy();
 
?>
Perspective projection
Do a 'Perspective' distortion biased on a set of 8 pre-calculated coefficients.
No example

Polar
Like 'Arc' but do a complete Cartesian to Polar mapping of the image.
Polar example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input ); 
$distort = array( 100,20133,150180,270 );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_POLAR$distortFALSE ); 
$im->writeImage('distort_polar.png'); 
$im->destroy();
 
?>
Polynomial

Can not find any notes for this

Scale rotate translate
Distort image by first scaling and rotating about a given 'center', before translating that 'center' to the new location.
Scale rotate translate example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input ); 
$distort = array( 28,24,  .4,.8,  -110,  50,120  );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_SCALEROTATETRANSLATE$distortFALSE ); 
$im->writeImage('distort_scalerotatetranslate.png'); 
$im->destroy();
 
?>
Sentinel

Can not find any notes for this

Shepards
Distort the given list control points (any number) using an Inverse Squared Distance Interpolation Method.
Shepards example

bool Imagick::distortImage ( int $method , array $arguments , bool $bestfit )

<?php 
$im 
= new imagick$input ); 
$distort = array( 0,00,00,10020,1000,2000,200133,200133,180266,200266,200266,100246,100266,0266,0133,0133,20  );
$im->setImageVirtualPixelMethodImagick::VIRTUALPIXELMETHOD_TRANSPARENT );
$im->setImageMatteTRUE );
$im->distortImageImagick::DISTORTION_SHEPARDS$distortFALSE ); 
$im->writeImage('distort_shepards.png'); 
$im->destroy();
 
?>