Fred's ImageMagick Scripts
|
Applies a skew distortion to an image |
last modified: December 29, 2008
|
USAGE: skew [-a amount] [-m mode] [-d direction] [-v vpmethod] [-b bgcolor] infile outfile
-a .... amount ......... amount of skew as either degrees or pixels as PURPOSE: Applies a skew distortion to an image. DESCRIPTION: SKEW applies a skew distortion to an image in either the X or the Y direction. The amount of skew can be specified in degrees or pixels. ARGUMENTS: -a amount ... AMOUNT of skew in either degrees or pixels as specified by the mode parameter. The default is 0 or no skew. -m mode ... MODE specifies whether the amount is in degrees or pixels. The default is degrees. -d direction ... DIRECTION specifies whether the skew is horizontal or vertical and at the same time whether positive or negative. This is done via the following options: b2r, b2l, r2b or r2t. These stand for: shift the bottom edge to the right, shift the bottom edge to the left, shift the right edge to the bottom and shift the right edge to the top. The default is b2r (shift the bottom edge to the right). -v vpmethod ... VPMETHOD is the virtual-pixel method to use to fill the area added due to the skew. Any valid IM virtual-pixel method is allowed. The default is background. -b bgcolor ... BGCOLOR specifies the background color to use as the fill color for areas added due to the skew when the virtual-pixel method is background. Any valid IM color may be used including none. The default is none. Note that none will only provide transparency for the fill areas, if the output image type supports transparency, e.g. png or gif. If none is specified and the output type does not support transparency, such as for jpg, then the resulting fill color will end up black. IMPORTANT: This script works properly as of IM 6.4.2-7 when some fixes were made to -affine -transform. For IM versions prior to this, the script will work to skew the image. The virtual-pixel methods are ignored, But background color control may not work as specified. Results may end up with transparent areas even if undesired for output image types that support transparency, such as gif and png. Also there may be an artifact showing for -d r2l results, especially when the background is transparent. CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
|
Original | |||
|
|||
|
Horizontal Skew To Right (B2R) | |||
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
Horizontal Skew To Left (B2L) | |||
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
Vertical Skew To Bottom (R2B) | |||
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
Vertical Skew To Top (R2T) | |||
|
Arguments: |
Arguments: |
Arguments: |
Arguments: |
|
|
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands for the
|