Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Applies a skew distortion to an image |
last modified: December 15, 2018
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
|