# 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. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_ARC, \$distort, TRUE );  \$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. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_BARREL, \$distort, TRUE );  \$im->writeImage('distort_barrel.png');  \$im->destroy();  ?> ``` Barrel inverse This is very similar to 'Barrel' with the same set of arguments, and argument handling. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_BARRELINVERSE, \$distort, TRUE );  \$im->writeImage('distort_barrelinverse.png');  \$im->destroy();  ?> ``` Bilinear Bilinear Distortion, given a minimum of 4 sets of coordinate pairs, or 16 values. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_BILINEAR, \$distort, TRUE );  \$im->writeImage('distort_bilinear.png');  \$im->destroy();  ?> ``` Depolar Uses the same arguments and meanings as a 'Polar' distortion but generates the reverse. Perspective Perspective distort the images, using a list of 4 or more sets of control points. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_PERSPECTIVE, \$corners, TRUE );  \$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. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_POLAR, \$distort, FALSE );  \$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. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_SCALEROTATETRANSLATE, \$distort, FALSE );  \$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. bool Imagick::distortImage ( int \$method , array \$arguments , bool \$bestfit )``` setImageVirtualPixelMethod( Imagick::VIRTUALPIXELMETHOD_TRANSPARENT ); \$im->setImageMatte( TRUE ); \$im->distortImage( Imagick::DISTORTION_SHEPARDS, \$distort, FALSE );  \$im->writeImage('distort_shepards.png');  \$im->destroy();  ?> ```