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. |
Superimposes a set of horizontal and/or vertical grid lines on an image. |
last modified: December 15, 2018
USAGE: grid [-s spacing] [-d displace] [-c color] [-t thickness] [-o opacity] infile outfile
-s ...... spacing ..... x,y spacing between grid lines; default=16,16 or 16; PURPOSE: To superimpose a set of horizontal and/or vertical grid lines on an image. DESCRIPTION: GRID superimposes a set of horizontal and/or vertical grid lines on an image. Parameters are available to select the grid line color, thickness and opacity. ARGUMENTS: -s spacing ... SPACING specifies the horizontal (x) and vertical (y) grid distance between lines. Spacing must be provided as non-negative integer values. If the second value is left off, then it will be set identical to the first. If only vertical lines are desired, set the horizontal (x) spacing larger than the width of the image. If only horizontal lines are desired, set the vertical (y) spacing larger than the height of the image. The default=16. Note: if you want the bottom and/or right grid line to show, then the image dimension(s) must be a multiple of the grid spacing plus 1. -d displace ... DISPLACE specifies the horizontal (x) and vertical (y) grid offset from the top left corner for the first grid line. Distance must be provided as non-negative integer values. If the second value is left off, then it will be set identical to the first. If you do not want the first grid line at x=0 and/or y=0, then specify the displace value as spacing-1. -c color ... COLOR is the color of the grid lines. Any valid IM color specification is allowed. Be sure to color values in double quotes. The default="black". -t thickness ... THICKNESS is the grid line thickness. Values are positive integers. The default=1 -o opacity ... OPACITY is the grid line opacity. Values are non-negative floats between 0.0 and 1.0. The default=1 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. |
Grid Lines Superimposed On Image |
|||||
Original Image |
arguments: |
arguments: |
arguments: |
arguments: |
arguments: |
What the script does is as follows:
This is equivalent to the following IM commands for the case of
|