Fred's ImageMagick Scripts



 

 

ANGLEGRADIENT


Creates a gradient effect at a specific orientation angle.

Download Script

last modified: May 30, 2008



USAGE: anglegradient widthxheight [-a angle] [-c color ] outfile
USAGE: anglegradient [-h or -help]

widthxheight ................... widthxheight of gradient image
-a .............. angle .........orientational angle for gradient;
................................ degrees rotation from a vertical in
................................ clockwise direction; default=0
-c .............. color(s) ..... gradient colororation; any valid
................................ single or hyphenated color including
................................ color-none

PURPOSE: To create a gradient effect at a specific orientation angle.

DESCRIPTION: ANGLEGRADIENT creates a gradient effect at a specific orientation angle.

ARGUMENTS:

widthxheight ... WIDTHxHEIGHT are the dimensions of the gradient image.

-a angle ... ANGLE is the orientation angle for the gradient effect. It is specified as a -180<=float<=180 degrees. The default is 0, which will produce the standard vertically oriented gradient.

-c color(s) ... COLOR(S) is any valid single or hyphenated IM color including color-color or color-none for a transition from one color to another. If no color is specified, then the normal grayscale will be generated

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.


EXAMPLES


Angle Gradient

Arguments:
128x128

Arguments:
128x128 -a 30

Arguments:
128x128 -a 30 -c red

Arguments:
128x128 -a 30 -c red-blue



What the script does is as follows:

  • Creates a normal gradient of the specified color
  • Rotates it using -distort SRT

This is equivalent to the following IM commands

  • convert -size $size gradient:"$colors" $tmp0
  • convert $tmp0 -distort SRT "$angle" $outfile