borderImage( "$distort_bg", 1, 1 ); #### PerspectiveProjection ### if ( $_GET[distort] == "PerspectiveProjection" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_PERSPECTIVEPROJECTION, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end PerspectiveProjection #### AffineProjection ### if ( $_GET[distort] == "AffineProjection" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_AFFINEPROJECTION, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end AffineProjection #### Affine ### if ( $_GET[distort] == "Affine" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_AFFINE, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end Affine #### SRT ### if ( $_GET[distort] == "SRT" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_SCALEROTATETRANSLATE, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end SRT #### ARC ### if ( $_GET[distort] == "Arc" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_ARC, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end Arc #### Perspective #### if ( $_GET[distort] == "Perspective" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_PERSPECTIVE, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end Perspective #### Bilinear #### if ( $_GET[distort] == "Bilinear" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_BILINEAR, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end Bilinear #### Undefined #### if ( $_GET[distort] == "Undefined" ) { # user may enter garbage so use exception to test try { $image->distortimage( imagick::DISTORTION_UNDEFINED, $args, TRUE); } catch ( exception $e ) { $_SESSION[error] = "Invalid input for selected distort method
"; header("location:$self"); exit; } } #### end Undefined # remove border that you added above. $frame->shaveImage(1,1); } # end frame loop $format = strtolower( $image->getimageformat() ); $path = "temp/$ID.$_SESSION[views].$format"; $frames = $image->getNumberImages(); if ( $frames > 1) { $image->writeImages("$path", TRUE); } else { $image->writeImage("$path"); } # save settings $_SESSION[distort_params] = $distort_params; $_SESSION[distort_bg] = $distort_bg; $_SESSION[path] = $path; header("Location: display.php"); exit; } ######### end Distort include("top.php"); ?>
Background Color:
Parameters:

Distort an image. Enter arguments separated by commas. You can use spaces and line breaks to make your input easier to read.

This works a little differently than Imagemagick. Instead of using a virtual pixel method it uses a background color. If you don't enter a background color it defaults to transparent for GIF's and PNG's, black for JPG's

Affine
Affine
AffineProjection
Arc
Distorts the image in an arc. Accepts up to four arguments. The first the degrees in the arc. The next three arguments are optional: Angle of rotation, top radius, bottum radius.
Bilinear
Same as Perspective but the edges of the finale quadrilateral will be curved instead of straight lines
Perspective
Perspective accepts eight x,y cooridinates, 16 arguments altogether. The cooridinates represent the starting and ending positions of the corners of a quadrilateral.
X1s,Y1s, X1e,Y1e, X2s,Y2s, X2e,Y2e, X3s,Y3s, X3e,Y3e, X4s,Y4s, X4e,Y4e
PerspectiveProjection
SRT
SRT stands for "Scale, Rotate and Translate". Combining the three operations provides a quick way to create frames on an animation among other things, It accepts three arguments; only the first is required. The arguments are:
  1. Angle of rotation
  2. ?
  3. Width scale factor. (.5=half; 2=double)
  4. Height scale factor. (.5=half; 2=double)
  5. ?
  6. ?
  7. ?