Fred's ImageMagick Scripts
|
Applies a cylinder distortion to an image so that the image is wrapped about the cylinder |
last modified: April 12, 2010
|
USAGE: cylinderize [-m mode] [-r radius] [-l length] [-w wrap] [-f fcolor] [-a angle] [-p pitch] [-n narrow] [-v vpmethod] [-b bgcolor] [-t] infile outfile
-m .... mode ......... mode of orientation for cylinder axis; options are PURPOSE: To apply a cylinder distortion to an image. DESCRIPTION: CYLINDERIZE applies a cylinder distortion to an image so that the image is wrapped about the cylinder. The image can be wrapped about any percentage of the cylinder from 10 to 100 percent. If the wrap is less than 100%, then the cylinder will be colored to fill the remaining amount. The cylinder can also be pitched (tilted). ARGUMENTS: -m mode ... MODE specifies the orientation for the cylinder axis. The choices are horizontal (or h) or vertical (or v). The default is horizontal. -r radius ... RADIUS is the radius of the cylinder in pixels. The values are floats>0. The default is one quarter of the image width or height depending upon the mode. -l length ... Length is the length of the cylinder along its axis in pixels. The values are floats with length>0. The default is either the width or height depending upon mode and adjusted for the pitch of the cylinder. If a length is provided, then the cylinder length will not be adjusted for pitch, but the ends will still be adjusted for pitch. -w wrap ... WRAP is the percentage of the cylinder circumference that is wrapped with the image. Values are floats such that 10<=wrap<=100. Default=50. -f fcolor ... FCOLOR is the fill color to put on the remainder of the cylinder that is not covered by the image. Any valid IM color is allowed. The default is none (for transparent). -a angle ... ANGLE is the rotation of the image about the cylinder. This is best used when wrap=full. The values are floats with -360<=angle<=360. The default=0. -p pitch ... PITCH (tilt) angle of the cylinder. Values are floats with -90<pitch<90. Positive values move the top or left side towards the user depending upon mode. The default=0. -p pitch ... PITCH (tilt) angle of the cylinder. Values are floats with -90<pitch<90. Positive values move the top or left side towards the user depending upon mode. The default=0. -n narrow ... NARROW is the percent ratio of the bottom-to-top or right-to-left radii used to simulate perspective tapering. Values are floats>=0. The default=100 means same size radii. -b bgcolor ... BGCOLOR is the background color to use when vpmethod=background. Any valid IM color is allowed. The background will be transparent if bgcolor=none and vpmethod=background. The default is black. -t ... TRIM the background. NOTE: Thanks to Anthony Thyssen for the concept and basic equation for achieving the tilted cylinder effect. Thanks to Glen Fiebich for the suggestion to allow any amount of wrap and to be able to fill the remainder with color or transparency and still rotate the cylinder. 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. |
|
No Pitch |
|
|
Original Image |
|
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
Rotation Animation |
|
|
|
|
Rotation Animation |
|
|
|
|
With 20 Degree Pitch |
|
|
Original Image |
|
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
Arguments: |
Arguments: |
|
|
|
With 45 Degree Pitch |
|
|
Original Image |
|
|
|
|
Arguments: |
Arguments: |
|
|
|
What the script does is as follows:
This is equivalent to the following IM commands for the
|