Full Documentation: Graphics Programs

Library version 9.4.3



autotile.icn: Program to produce tile from XBM image

January 3, 1994; Ralph E. Griswold
This file is in the public domain.

This program creates a tile of a specified size by processing an
XBM image file.  The tile grid is "laid over" the image to form squares.

The non-white pixels in each square of the image are counted. If the
percentage of non-white pixels exceeds a specified threshold, the
corresponding bit in the tile is set.

The supported options are:

     -h i    tile height, default 32
     -w i    tile width, default 32
     -t r    threshold, default 0.50

[ Summary entry | Source code ]


binpack.icn: Program to demonstrate some bin packing algorithms

June 23, 2000; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  binpack [window options]

Binpack illustrates several approximation algorithms for solving the
one-dimensional bin packing problem.

For references, see the "info" screen.

[ Summary entry | Source code ]


bitdemo.icn: Program to demonstrate bitplanes

November 14, 1994; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   bitdemo illustrates some of the techniques made available by the
bitplane package in the program library.

   The upper rectangle is drawn using three bitplanes, reserving
one plane for each of the primary colors.  After clicking one of
the "draw" or "erase" buttons, you can draw or erase any one of
the bitplanes independently of the others.  Notice what happens
when the colors overlap.

   Drawing is not constrained to the rectangle so that you can see
some of the possible consequences of using the bitplane routines
improperly.

   The lower rectangle is drawn using four other bitplanes, one each
for the four types of objects.  Click once on a button to bring the
objects of that type to the front.  Click a second time to make them
invisible.

[ Summary entry | Source code ]


blp2grid.icn: Program to convert BLP drawdown to grid image

June 26, 2002; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

The following options are supported:

     -s i    size of cells; default 5
     -c s    color for filling cells; default black

Also handles row files.

[ Summary entry | Source code ]


blp2rows.icn: Program to convert bi-level pattern to row file

October 30, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.


[ Summary entry | Source code ]


bme.icn: Program to edit bitmap

June 17, 1994; Clinton L. Jeffery
Requires: Version 9 graphics
This file is in the public domain.

    A bitmap editor.  This is really the PixMap editor
pme.icn with colors set to black and white, and color changes disabled.

    Left and right mouse buttons draw black and white.
Press q or ESC to quit; press s to save.  Capital "S" prompts for
and saves under a new filename.

[ Summary entry | Source code ]


bpack.icn: Program to demonstrate some bin packing algorithms

August 7, 1998; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  bpack [window options]

Bpack illustrates several approximation algorithms for solving the
one-dimensional bin packing problem.

For a discussion of this program, see
     http://www.cs.arizona.edu/icon/oddsends/bpack/bpack.htm

For references, see the "about" screen.

[ Summary entry | Source code ]


breakout.icn: Program for Breakout game

September 3, 2000; Nathan J. Ranks
Requires: Version 9 graphics
This file is in the public domain.

Breakout game

Infinite balls, Left or Right click to start or restart after losing ball
9 levels - can select any level when not active using 1-9
1 hit, 2 hit, 3 hit, and invincible blocks can be used for levels

[ Summary entry | Source code ]


browser.icn: Program to demonstrate file-navigation "dialog"

July 10, 2002; Ralph E. Griswold
This file is in the public domain.

Requires:  Version 9 graphics

[ Summary entry | Source code ]


ca21.icn: Program to investigate cellular automata

May 2, 2001; Ralph E. Griswold
Requires: Version 9 graphics; system(), pipes, /tmp for -e option
This file is in the public domain.

This program displays the time-sequence development on one-dimensional
cellular automata in which the state of a cell depends only on the
two cells adjacent to it -- 2,1 automata.

See "Theory and Applications of Cellular Automata", Stephan Wolfram,
World Scientific, 1986 for an explanation for the method and rule
encoding.

The options supported are:

     -r i    rule i, default 110
     -w i    width (number of cells), default 200
     -h i    height (number of time steps), default width
     -s      seed first row at random with <= width / 2 cells
     -R      randomize the run
     -e s    initialize first row with seeds at positions generated
                by Icon expression e.
     -i s    save final image in file named s; default no image
     -H      use hidden window; if no image file specified, ca21.gif
                is used

The -e option is powerful but somewhat strange.  For example, to
seed every other cell in the first row, use

     -e 'seq(1,2')

which generates 1, 3, 5, 7, ... and seeds those cells (cells are
numbered starting at 1).

[ Summary entry | Source code ]


calib.icn: Program to calibrate color monitor

May 31, 1994; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   The nonlinearity of a color display is often characterized by a
"gamma correction" value; calib provides a crude method for determining
this value for a particular monitor.  It displays two rectangles: one
formed of alternating black and white scanlines and one formed of a
single, solid color.  Move the slider until they match; the number
displayed above the slider is the gamma-correction factor.

[ Summary entry | Source code ]


cameleon.icn: Program to allow user to change colors in an image

May 19, 1999; Ralph E. Griswold
Requires: Version 9 graphics and mutable colors.
This file is in the public domain.

This application allows the user to change selected color in an image.
The colors are displayed in a palette on the application window.
Clicking on one brings up a color dialog in which the color can be
adjusted.

The keyboard shortcuts are:

     @O      open image                      File menu
     @Q      quit the application            File menu
     @R      revert to original colors       Colors menu
     @S      save image                      File menu

Note:  "cameleon" is a variant spelling of "chameleon".

[ Summary entry | Source code ]


chernoff.icn: Program to imitate a Chernoff face

August 14, 1996; Jon Lipp
This file is in the public domain.

This program displays a Chernoff face.

[ Summary entry | Source code ]


clrs2pdb.icn: Program to create custom palettes from color lists

October 29, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program builds a palette database from color lists.

[ Summary entry | Source code ]


coloralc.icn: Program to test color allocation

February 6, 1995; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   coloralc tests how many fixed and/or mutable colors can be allocated.
The two sets of pushbuttons allocate 1, 8, or 32 randomly chosen colors
of the selected type.  New colors are arrayed on the display using
squares for fixed colors and discs for mutable colors.  When no more
colors can be created, no more squares or discs will appear.

   Clicking on a color with the left mouse button selects it as the
current color; the current color can be drawn on the screen by moving
the mouse with the left button down.

   Clicking on a mutable color (a disc) with the right mouse mutton
changes it to a new random color.  There is also a pushbutton that
changes all mutable colors simultaneously.

[ Summary entry | Source code ]


colormap.icn: Program to display palette from color list

November 17, 1997; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program shows the colors given color list files given on the
command line.

colormap will display color lists with more than 256 entries but,
of course, it cannot display more than 256 different colors (if that
many).

[ Summary entry | Source code ]


colorup.icn: Program to produce a weave structure from unravel data

April 18, 2000; Ralph E. Griswold
This file is in the public domain.

Input is expected to be the output of unravel -r.
____________________________________________________________

This program takes information from a image solved by unravel.icn to
produce a draft.

The option -o i determines how optional choices at intersections are
handled:

     0       random (default)
     1       warp
     2       weft
     3       alternating

[ Summary entry | Source code ]


colorwif.icn: Program to produce a WIF from unravel data

April 24, 2001; Ralph E. Griswold
This file is in the public domain.

Input is expected to be the output of unravel -r.
____________________________________________________________

This program takes information from a image solved by unravel.icn to
produce a draft.

The option -o i determines how optional choices at intersections are
handled:

     0       random (default)
     1       warp
     2       weft
     3       alternating

[ Summary entry | Source code ]


colrbook.icn: Program to show the named colors

December 1, 1997; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   colrbook is a mouse-driven program for choosing named colors.
Along the left are 24 equally spaced hues plus black, gray, white,
brown, violet, and pink.  Click on any of these to see the twenty
colors that are possible by adding lightness and saturation
modifiers to the particular hue.

[ Summary entry | Source code ]


colrname.icn: Program to browse color names

August 3, 2000; Clinton L. Jeffery
Requires: Version 9 graphics with mutable colors and X.
This file is in the public domain.

    An X color name browser.

    Click on a colorname to change the window's background color.
Not very interesting on a monochrome server.

[ Summary entry | Source code ]


colrpick.icn: Program to pick RGB or HLS colors

February 27, 1995; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   colrpick provides a command-level interface to the ColorDialog
procedure.  The ColorValue() of the selected color is written to
standard output when the Okay button is pressed.  If the Cancel
button is pressed, colorpick exits with an error by calling stop().

   A default color can be specified by one or more command arguments,
for example "colrpick deep green".

[ Summary entry | Source code ]


concen.icn: Program to play solitaire card game Concentration

December 4, 1997; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

usage: concen [winoptions] [ncards]

   Concentration, as presented here, is a simple solitaire game.
When the program starts, there are 52 playing cards, face down.
They may be turned over by clicking on them with the mouse.  Only
two cards may be face up at a time; if they are the same rank
(e.g. two sevens), they are removed.  The object is to clear the
table.

   (For an interesting discussion of two-person Concentration, see
Ian Stewart's "Mathematical Recreations" column in the October,
1991, edition of Scientific American, entitled "Concentration:
A Winning Strategy".)

[ Summary entry | Source code ]


cquilts.icn: Program to create "chaotic square quilts"

March 14, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program creates square quilting patterns as described in
"Symmetry in Chaos", Michael Field and Martin Golubitsky, Oxford
University Press, 1992.

Instead of plotting an image, the values are computed and saved
in "numerical carpets" for off-line plotting.

The following options are supported:

     -i i    Save carpet files every i iterations; default 100000

     -p s    Prefix for carpet file names, default q_

     -t i    Terminate execution after i iterations; default no limit

Warning:  This program takes a long time to go through enough iterations
to produce nice results.

Note:  This is an unfinished work, supplied for interest only.

There are several sections of parameter values below.  All but one
is commented out.  Change this to get other patterns.

[ Summary entry | Source code ]


cw.icn: Program to manipulate color ways

August 19, 1996; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

See colorway.icn for documentation

[ Summary entry | Source code ]


dd2draft.icn: Program to create draft information from drawdown

November 16, 2001; Ralph E. Griswold
This file is in the public domain.

This program reads a drawdown in terms of rows of zeros and ones from
standard input and outputs draft information in textual form.

It also accepts BLPs as input.

[ Summary entry | Source code ]


dd2res.icn: Program to compute loom resources needed from drawdown

July 8, 2002; Ralph E. Griswold
This file is in the public domain.

This program reads a pattern in row or BLP format.

The number of shafts and treadles required is written to standard
output.

[ Summary entry | Source code ]


dd2unit.icn: Program to get dimensions of unit motif of pattern

procedure grepeat:         reduce grid to smallest repeat
June 12, 2002; Ralph E. Griswold
This file is in the public domain.

The following command line option is supported:

     -p      assume partial repeats may occur at edges of pattern;
             default complete repeats

[ Summary entry | Source code ]


dd2wif.icn: Program to produce a WIF from drawdown

July 4, 2002; Ralph E. Griswold
This file is in the public domain.

This program reads BLPs that represent drawdowns.  The names of BLP
files are given on the command line.  WIF files are output.

The following option is supported:

     -w      make Web page; default don't

If Web pages are being produced, the extension "html" is used; otherwise
"wif".

[ Summary entry | Source code ]


ddextend.icn: Program to extend pattern to a minimum size

June 11, 2002; Ralph E. Griswold
This file is in the public domain.

This program reads a drawdown from standard input in the form of
rows of zeros and ones, in which ones indicate places where the
warp thread is on top and zeros where the weft thread is on top.
It also accepts a BLP as input.

At present, the minimum size is 16, built in.  This should be changed
to a value that could be specified as an option.

It outputs a BLP.

[ Summary entry | Source code ]


design1.icn: Program to draw spokes design

February 17, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This is just an example of an interesting graphic design.  It can
easily be modified to produce other designs.

[ Summary entry | Source code ]


design2.icn: Program to draw circular design

February 17, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program draws a design in which i points around a circle are
all connected to each other.  The number of points is given as
a command-line argument (default 20).  Values larger than 30 produce
results that are too dense to be interesting.

[ Summary entry | Source code ]


design3.icn: Program to draw square design

February 17, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program draws a design in which i points around a square are
all connected to each other.  The number of points along a side
(default 10) and the distance between them (default 40) are given as
command-line arguments.

[ Summary entry | Source code ]


dlgvu.icn: Program to display USGS DLG map files

October 2, 2005; Gregg M. Townsend and William S. Evans
Contributor: Frank Glandorf
Requires: Version 9 graphics
This file is in the public domain.

Dlgvu displays and prints USGS digital map data.

usage:  dlgvu [options] file...

Each file argument is one of:
    a directory containing DLG files in SDTS format
    a ZIP format archive of such files  (requires "unzip" utility)
    a text file containing coordinates of paths and features

All interaction is via mouse actions and keyboard shortcuts.
The display window may be resized as desired.
____________________________________________________________

Command options:

-c          display coverage map only, without loading data
-d          print some debugging data
-n          no display; just report statistics, and then quit
            (this still requires X-Windows, unfortunately)
-p          use slower, more precise coordinate conversion
-q          quiet mode: no commentary to stdout
-t          load only maps traversed by paths, ignoring others
-o logfile  specify output log to use instead of standard output

-l abcd     display only layers a, b, c, d
-x abcd     exclude layers a, b, c, d

        For -l and -x, the following layer codes are used.
        (USGS equivalents are given in parentheses.)

        b  boundaries           (BD: boundaries)
        c  contour lines        (HP: hypsography)
        d  sand, gravel, lava   (NV: nonvegetative features)
        f  feature labels       read from text files
        g  GPS paths            read from text files
        l  land sections        (PL: public lands)
        m  markers              (SM: survey markers)
        n  file names
        o  other                unknown layers from non-DLG data
        r  roads                (RD: roads)
        s  structures           (MS: manmade structures)
        t  train tracks         (RR: railroads)
        u  utilities            (MT: miscellaneous transportation)
        v  vegetation           (SC: surface cover)
        w  water                (HY: hydrology)

Additionally, the standard Window() options are accepted;
in particular, "-F fgcolor" sets the color used for drawing
unrecognized ("other") layers, as from USGS "National Atlas"
digital files, and "-G 800x500" sets the initial window size.

Typical usage is simply
        dlgvu dir1 [dir2 ...]
to display one or more adjacent maps.  The -x option can speed
things up by excluding unwanted layers; the contour layer is
especially slow.

A ZIP archive can replace a directory name if Icon can open
the unzip program via a pipe.  For example:
        dlgvu woodside.zip palo_alto.zip
____________________________________________________________

Mouse actions:

To zoom to a particular region, sweep out the region using the
left mouse button.  To cancel a sweep, reduce its width or height
to fewer than ten pixels.

If nothing appears to be happening after zooming in, the program
is probably drawing offscreen.  It's not smart about that.  Be
patient, and it will soon display the visible region.

To display the latitude / longitude of a location, and a scale bar,
hold down the right mouse button.

To record a labeled feature, shift-click the left mouse button.
Enter a name in the pop-up dialog box.  The location and name are
written to the log file and added to the feature layer of the map.

To record an anonymous location to the log file, shift-click with
the right mouse button instead.  No dialog box appears.  A sequence
of anonymous locations can be read as a path by a subsequent
program run.
____________________________________________________________

Keyboard actions:

+ or =          zoom in
- or _          zoom out
0 or Home       zoom to initial view
arrow keys      pan the display  (hold Shift key for smaller pan)

b, c, d, etc.   toggle display of specified layer
a               display all loaded layers including n (file names)
x               display no layers (just an empty window)

Esc             stop drawing  (any unrecognized key does this)
space or Enter  redraw screen  (e.g. after inadvertent interrupt)
q               quit

p or PrntScrn   print visible portion to PostScript file

The file produced by PrntScrn is an Encapsulated PostScript file
suitable either for direct printing ("lpr file.ps") or for import
into another document.
____________________________________________________________

Input files:

In directories and archives, only files with names ending in .ddf
or .DDF are read; others are ignored.  These files must be in SDTS
(Spatial Data Transfer Standard) format, which is used by the USGS
for all new DLG files.

Text files supply coordinates for features or paths.  GPS receivers
are one possible source for such data.  A text file can supply
paths, features, or both.

Paths are specified by sequences of lines that end with two decimal
values.  The values are interpreted as latitude and longitude, in
that order.  An interruption in the sequence (such as a blank line)
indicates a break between paths.

Features, or waypoints, are given by lines that *begin* with two
decimal values.  The rest of the line is taken as a label, which
must not be empty and must not end with two decimal values.

Any other line in a text file breaks a path sequence but is
otherwise ignored.
____________________________________________________________

About DLG files:

Dlgvu was written to display digitized topographic maps produced
by the United States Geological Survey (USGS).  The current file
format is based on the Spatial Data Transfer Standard (SDTS).
Some older files are available in other formats (including
"standard" and "optional") not supported by this program.

DLG files are available free from the USGS at this web page:
        http://edc.usgs.gov/doc/edchome/ndcdb/ndcdb.html
Coverage is incomplete.  24K maps, the most detailed, are available
for only some areas, and many maps lack some of the data layers.

Each map is represented by a collection of gzipped tar files
(one for each map layer) that are unpacked for display.  Multiple
files versions may be available, and not all layers are available
for all maps.

IMPORTANT:  Do not blindly unpack all the tar files of a map into
the same directory; due to the use of duplicate file names in the
transportation layers, some files will be overwritten.  Instead,
unpack the roads, railroads, and miscellaneous transportation
layers separately, each time renaming the TR*.DDF files to RD*.DDF,
RR*.DDF, and MT*.DDF respectively.

Dlgvu has mainly been tested and tuned using "large scale" DLG
files (1:24000 scale, covering 7.5 minute quadrangles).  Other
scales produce less attractive displays, partly due to different
encodings:  For example, the same residential streets may be encoded
as "Class 3 Roads" in 24K files but "Class 4 Roads" in 100K files.

Dlgvu does not presume to understand ISO 8211, DDF, STDS, and TVP
in their full complexity and generality.  Undoubtedly it is making
some unwarranted assumptions based on observed practice.  The file
renaming recommended above is contrary to specification but allows
a complete map to be stored in a single flat directory.

For more information, and some sample data files, visit:
        http://www.cs.arizona.edu/icon/oddsends/dlgvu/
____________________________________________________________

Displayed features:

DLG files are rich in detail.  Dlgvu displays only some of this
encoded data.

Put simply, dlgvu understands point and line features but not
area features.  It draws a small square for a structure location,
or draws the outline of a large building, but it does not color in
an "urban area" in which individual structures are not plotted.
It displays the shoreline of a river, and any islands, but does
not understand enough to color the river area itself blue.

Dlgvu recognizes some line features for special display.  For
example, major roads are drawn with wide lines, and trails are
drawn with dashed red lines.  Lines with unrecognized attributes,
or no attributes, are drawn in a default style.  Point features
("school", "windmill", etc.) are not distinguished.

Area features are drawn only in outline.  The most obvious of
these are vegetated areas and urban areas.  Land section and
civil boundaries also delimit area features.

Colors are assigned as follows (with layer codes on the left):

        b  boundaries           gold
        c  contour lines        tan
        f  feature labels       black
        g  GPS path             bold pink over "highlighter"
        l  land sections        pale red
        m  survey markers       blue
        n  file names           green
        o  other data           brown (can override with -F option)
        r  roads, class 1-3     black or dark gray
        r  roads, class 4-5     dashed dark gray
        r  trails               dashed red
        s  structures           brownish gray
        t  railroads            rust
        t  rapid transit rails  dark blue
        u  pipelines            dashed purple
        u  power lines          purple
        u  airport runways      gray
        v  vegetation           light green
        w  water                light blue
        x  sand, gravel, lava   greenish gray

Dlgvu uses a simple rectangular projection that is satisfactory
for small areas like 24K quadrangles but less suitable for large
areas such as whole states.
____________________________________________________________

The loading process:

Data is loaded in two phases.  A quick preloading phase determines
the available layers and the geographic areas covered.  A status
line is output for each file.  For example:

        bcl-r-tu-w N27 15 C66 42a 93a  ia/ames-w

The first field shows which layers were found.  N27 declares that
coordinates use the NAD 1927 geodetic datum; N83 for NAD 1983 is
the other likely value.  15 is the UTM zone number; state maps with
latitude/longitude data show "LL" here.  C66 means that the data
appears to have been projected using the Clarke 1866 ellipsoid; the
other likely value is "G80" for the GRS 1980 ellipsoid.  Dlgvu uses
this to infer the datum, because the declared datum value is a less
reliable indicator.

"42a 93a" gives the coordinates of the southeast corner of the map,
in degrees North and West, with letters "a" through "h" indicating
fractions from 0/8 through 7/8.  The final field is the file name.

If the layers in a file are inconsistent (for example, in the
inferred ellipsoid), multiple lines appear with a "*" prefix.
If display of a file is suppressed by the "-t" option, an X
prefixes the line.

For text files, a notation such as "3:489+0" replaces layer
indicators, counting continuous segments, total points, and
feature labels.  Coordinate values are assumed to use the
WGS 1984 ("W84") datum and ellipsoid.

The display appears during the longer second loading phase.  For
each layer of each input file, bounds are drawn and a progress bar
changes as data is read.  The color of the label indicates the
layer being loaded.
____________________________________________________________

Tiling multiple maps:

Multiple maps are displayed in proper relation.  To quickly see
how the maps of a set will join, use "dlgvu -c".

Small gaps or overlaps occasionally appear along boundaries when
maps are tiled; these are symptomatic of inconsistent datums, and
they reflect the true relationships of the maps to the earth.

Dlgvu loads all necessary data into memory, so there is a very
real limit to the amount of data that can be displayed.  Contour
lines, especially, take lots of memory, but they can be excluded
by calling "dlgvu -xc".  A 128MB Linux system can typically
display three to five complex 24K quadrangles simultaneously
without thrashing.
____________________________________________________________

Known problems:

On Linux, we have seen occasional crashes of the XFree86 server,
especially under conditions of tight memory and/or extreme zooming.

Colors on printed maps vary somewhat from those seen onscreen,
depending on the printer.  Printed maps do not include the "n"
(file name) layer.

While data is being loaded from a ZIP file, interrupting with ^Z
can disrupt the "unzip" pipe and cause the program to crash or to
display artifacts after resumption.

Some 100K USGS maps come with multiple sets of boundary files,
leading to file name collisions for which no workaround has been
found.

[ Summary entry | Source code ]


drawup.icn: Program to create draft from drawdown

January 23, 2002; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program produces an ISD from a bi-level image string or row file.

The following option is supported:

     -n s    draft name, default "drawup"

     -r      interpret input as row pattern; default image string

[ Summary entry | Source code ]


drip.icn: Program to demonstrate color map animation

May 31, 1994; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

usage:  drip [-n ncolors] [-c correlation] [-d delay] [window options]

   drip uses color map animation to simulate the spread of colored
liquid dripping into the center of a pool.

   ncolors is the number of different colors present at one time.

   correlation (0.0 to 1.0) controls the similarity of two consecutive
colors.  It probably doesn't meet a statistician's strict definition
of the term.

   delay is the delay between drops, in milliseconds.  This may not be
needed; speed seems to vary greatly among different X servers, even on
the same machine.

[ Summary entry | Source code ]


etch.icn: Program for distributed Etch-A-Sketch

June 17, 1994; Clinton L. Jeffery
Requires: Version 9 graphics
This file is in the public domain.

A drawing program.  Invoked with one optional argument, the
name of a remote host on which to share the drawing surface.

Dragging the left button draws black dots
The middle button draws a line from button press to the release point
The right button draws white dots
Control-L clears the screen
The Escape character exits the program

[ Summary entry | Source code ]


facebend.icn: Program to generate caricatures

October 7, 1997; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Facebender is a caricature generator.  Read in an image and use the
left mouse button to pick the key points as prompted.  Click the
right button to skip a feature.  Pull down "drawing" on the display
menu to see the caricature.  Move the slider to change the distortion.
____________________________________________________________

References:

A. K. Dewdney, "Computer Recreations". Scientific American, Oct. 1986.
Reprinted in two collections of his columns, both from W. H. Freeman:
The Armchair Universe (1988) and The Tinkertoy Computer (1993).

Susan E. Brennan, "Caricature Generator: The Dynamic Exaggeration of
Faces by Computer."  Leonardo, Vol.18 no.3, 1985, pp. 170-178.

[ Summary entry | Source code ]


fetti.icn: Program to explore families of confetti squares

November 12, 1997; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

    Fetti is an interactive program for generating decorative
web-page sidebars composed of randomly colored squares.  Many
different parameters can be varied on the control panel.  Note
that the mouse must be over a numeric field to type in a new
value.

[ Summary entry | Source code ]


fev.icn: Program to display text in fisheye view

June 17, 1994; Clinton L. Jeffery
Requires: Version 9 graphics with X11R5 scalable fonts on the X server
This file is in the public domain.

    A text file browser that employs a fish-eye view.  The
fish-eye view displays text in a larger font in the middle (focus)
gradually declining to tiny fonts at the top and bottom of the screen.

    "q" or ESC to quit.  "n" slides the focus down one line
"p" slides the focus up one line.  "w" widens the focus by one.
"W" narrows the focus by one.  Mouse clicks move the focus to the line
on which the mouse is located; clicking in the left margin moves
in the file proportional to the mouse's y coordinate in the window.

[ Summary entry | Source code ]


fileimag.icn: Program to create GIF image of file text

July 8, 1997; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program creates an image file for a text file.  The results are
unpredictable for binary files or files with control characters.

The image may be too large for a window.

Badly needed are options for the font.

[ Summary entry | Source code ]


findrpt.icn: Program to find smallest repeat in a repeat pattern

December 5, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program produces the smallest motif in an image that will tile
to the image.

The image to be processed must be a "true" repeat -- pixel for pixel.

The options supported are:

     -n s    suffix for output image, default _t.  The suffix is
             appended to the basename of the input image, as in
             foo.gif -> foo_t.gif.

     -s      show size; default produce image

Warning:  This program is *very* slow.

[ Summary entry | Source code ]


findtile.icn: Program to find tiles in an image

January 7, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program is designed to assist in locating areas within an image
that, when tiled, produce a desired effect.  For example, a background
may consist of a tiled image; this program can be used to find the
smallest tile for the repeat (by "eye-balling").  It's worth noting
that interesting images can be found for other settings.  For example,
another interesting use of this program is to produce striped patterns by
selecting a row or column of an image to get a tile that is one character
wide.  Sometimes a few rows or columns give an interesting "fabric"
effect.

There are three windows:

     the VIB control window
     the source image window
     a repeat window, which shows the selection from the source
       image, tiled.

The selection from the source image is shown as a marquee in the
source image window.  When a source image is loaded, the marquee starts
with the entire image.  The marquee can be changed by buttons and
arrow-key events on the control window (not the source image window).

The arrow keys have two modes.  With no modifier, they nudge the
location of the marquee.  With the meta-key modifier, they nudge
the dimensions of the marquee.

The reset button resets the marquee to the entire image.

The current selection can be mirrored using the mirror button.

The following features are provided through keyboard shortcuts:
the File menu, and in some cases, on-board buttons:

     @O      open new source image
     @Q      quit application
     @S      save current selection as an image
     @Z      set size precisely

The repeat window can be resized by the user, but it is not redrawn
until the marque is changed or the refresh button is pushed.

[ Summary entry | Source code ]


flake.icn: Program to draw a fractal snowflake

August 14, 1996; Stephen B. Wampler
Requires: Version 9 graphics and co-expressions (for glib.icn)
This file is in the public domain.

Comments: This program display a fractal snowflake of specified
    order.  Options exist to do colors, etc.
    See the procedure 'helpmsg' for command line options

    An order 4 snowflake is particularly nice.

    Waits for a window event before closing window

[ Summary entry | Source code ]


floats.icn: Program to count floats

July 15, 2002; Ralph E. Griswold
This file is in the public domain.

This program analyzes the floats in a drawdown as a BLP or row file
from standard input.

[ Summary entry | Source code ]


flohisto.icn: Program to display float histograms

June 28, 2002; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program analyzes the floats in BLPs for drawdowns.

The names of BLPs are given on the command line.  The output images
are named <basename>_float.gif

[ Summary entry | Source code ]


fmap2pdb.icn: Program to create custom palettes from color maps

May 15, 2000; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program builds a palette database from Fracting color maps.

[ Summary entry | Source code ]


fontpick.icn: Program to show the characters of a font

August 23, 1995; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  fontpick [fontname]

fontpick is an interactive tool for displaying fonts.  Initially, the
specified font, or the VIB default font, is displayed.  To display a
different font, type its name and press return.  To exit, enter Meta-Q
or click the QUIT button.

Caveats:
-- any character that is too large is clipped to fit its cell
-- the window cannot be resized to handle large fonts

[ Summary entry | Source code ]


fractclr.icn: Program to map Fractint color maps to Icon color lists

January 1, 1996; Ralph E. Griswold
This file is in the public domain.

This program converts Fractint .map files to lists of Icon colors.

[ Summary entry | Source code ]


fractlin.icn: Program to demonstrate fractal lines

August 3, 2000; Stephen Wampler
Requires: Version 9 graphics and co-expressions (for glib.icn)
This file is in the public domain.

Comments: This program shows how fractal lines work.

    See the procedure 'helpmsg' for command line options

    Waits for a window event before closing window

[ Summary entry | Source code ]


fstarlab.icn: Program to draw fractal stars

May 2, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program draws fractal "stars".  For a discussion of fractal
stars, see

     Fractals; Endlessly Repeated Geometrical Figures, Hans Lauwerier,
     Princeton University Press, 1991, pp. 72-77.

and

     Geometric and Artistic Graphics; Design Generation with
     Microcomputers, Jean-Paul Delahaye, Macmillan, 1987, pp. 55-63.

The window is square.  The window size can be given on the command line,
default 600.

The present user interface is crude.  To see all the fractal stars
that are provided by default, type

     all

from standard input.  After each star is drawn, the program waits
for an event before going on to the next star.

Alternatively, a single star can be drawn by typing its name preceded
by an equals sign.  The names are fstar01 through fstar13.  For example,

     =fstar09

draws the ninth star.

In future extensions, provision will be made for user-defined stars.

[ Summary entry | Source code ]


gallery.icn: Program to display many images at once

August 3, 2005; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  gallery [-{whs}nnn] [-{rmtud}] file...

Gallery displays multiple images in a single window.  The images
are shrunken by resampling and tiled in columns or rows.

GIF and XPM format images are always supported.  JPEG format is
supported when built by Jcon.  JPEG, PPM, TIFF, PNG, and RLE formats
are also available under Unix if the necessary conversion utilities
are available in the shell search path.

When the window fills, diagonal lines in the extreme corners of the
window indicate that you can press Enter for the next screenful.
Solid triangles appear when there are no more images; press Q to exit.

At either of those pauses, pressing 'S' brings up a dialog for saving
a snapshot of the window.  Clicking the left mouse button on an
image displays a popup window with information about the image.  A
second click dismisses the popup, as does the space bar or Enter key.
The right mouse button activates the same popup momentarily until
the button is released.

-wnnn sets the maximum width for displaying an image;
-hnnn sets the maximum height.  -snnn sets both.
By default, sizes are chosen automatically, subject to a minimum
size of 32x32, to allow all images to fit in a single window.

-r arranges images in rows instead of columns.
-m maximizes the window size before displaying images.
-t trims file names of leading path components and extensions.
-u shows images completely unlabeled.
-d prints some debugging information.

The standard Window() options are accepted and can be used to
set the window size and other parameters.  A default gamma value
of 1.0 can be changed by using (e.g.) "-A gamma=1.6".

-cn and -gn options, which formerly selected a color palette,
are now ignored.

[ Summary entry | Source code ]


gamma.icn: Program to perform gamma correction on images

March 5, 1998; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program allows changing the gamma correction for images.  It can
be used, for example, to desaturate images for use as backgrounds.
Note:  Fully saturated nd fully unsaturated colors are not affected by
gamma correction.

[ Summary entry | Source code ]


gif2blp.icn: Program to convert B&W GIF to a BLP

March 4, 2003; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

AD HOC.  Assumes any non-black pixel is white.

[ Summary entry | Source code ]


gif2isd.icn: Program to produce a ISD from bi-level image

November 17, 2001; Ralph E. Griswold
This file is in the public domain.

This program takes a B&W GIF image whose name is given on the
command line and writes an ISD for a draft to standard output.

If the GIF is not strictly B&W, non-black pixels are assumed to
be white.

[ Summary entry | Source code ]


gif2rows.icn: Program to convert B&W GIF to 0/1 rows

August 11, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

AD HOC.  Assumes any non-black pixel is white.

[ Summary entry | Source code ]


gif2wif.icn: Program to produce a WIF from black & white image

May 7, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program takes the name of a GIF file for a black & white image
and outputs a WIF for a corresponding draft.  If the GIF is not
strictly black & white, all non-black pixels are interpreted as
white.

[ Summary entry | Source code ]


gifs2pdb.icn: Program to produce custom palettes from GIF images

April 13, 2000; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program makes a custom palette database from the colors in GIF
images

[ Summary entry | Source code ]


giftoims.icn: Program to convert GIF files to image strings

June 10, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts GIF images whose names are given on the command
line to image strings as used by DrawImage().

The image strings are written to files with the basenames of the GIF
files and the suffix "ims" or "iml" depending on the output option.

The following options are supported:

     -l      write Icon literal instead of plain string; suffix is
               .iml (default .ims).
     -i i    make lines of literals at most i characters long
     -p s    palette to use; default c1.

For -l, the length refers to the number of characters represented.  If
they require escapes, thea actual line length will be longer.  This is
to prevent errors from trying to continue a string literal in the
middle of an escape sequence.  In addition, three blanks are prepended
to each line and the characters # and $ are escaped to prevent then
from being misinterpreted by Icon's translator.

.iml files are suitable for inclusion in program text, either
directly or by $include.

.ims files are suitable for reading.

[ Summary entry | Source code ]


giftopat.icn: Program to convert GIF image to hex-form pattern

May 29, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program convert GIF images, whose names are given on the command
line to bi-level patterns.  The GIFs are expected to be black and white.
All non-white pixels are treated as black

[ Summary entry | Source code ]


gpxtest.icn: Program to test graphics procedures

August 1, 1998; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

This program exercises a wide variety of graphics operations.  Several
independent output tests are run in square cells within a window.  The
resulting image can be compared with a standard image to determine its
correctness.

The "Dialog" button brings up an interactive dialog box test; the
"Quit" button exits the program.

Some variations among systems are expected in the areas of fonts,
attribute values, and availability of mutable colors.  The first test,
involving window resizing, produces results that do not exactly fit the
grid pattern of the other tests; that is also expected.

This program is designed for a color display, but it also works on
monochrome systems.

[ Summary entry | Source code ]


gridedit.icn: Program to create and edit binary arrays

December 21, 1999; Ralph E. Griswold
Requires: Version 9 graphics, /tmp
This file is in the public domain.

This application provides a variety of facilities for creating and
editing binary arrays.  It is intended for use with weaving tie-ups
and liftplans.

[ Summary entry | Source code ]


gxplor.icn: Program to explore graphics facilities

July 20, 1998; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  gxplor [-s] [window options]

   gxplor is an interactive explorer for experimenting with Icon's
graphics facilities.  Commands read from standard input set window
attributes or invoke procedures.  Result values are reported on
standard output.  Errors are caught when possible.

   Here's an example, with commentary at the side,  that illustrates
some of the possibilities:

    % gxplor                        start program; a window appears
    > fg                            query value of "fg" attribute
    black
    > fg blue                       set "fg" attribute
    blue
    > linewidth 7                   set "linewidth" attribute
    7
    > drawline 12 20 55 73          a fat blue line appears
    > erasearea                     clear window
    > fillarea
    [unrecognized]                  oops -- wrong name
    > fillrectangle
    > pattern                       query "pattern" attribute
    [failed]
    > pattern grid                  set it
    grid
    > fillstyle
    solid
    > fillstyle opaque
    error 205: invalid value
    > fillstyle textured            set fillstyle
    textured
    > clip 50 50 400 200            set clipping
    > fillrectangle                 fill clipped area with pattern
    > zoom 40 40 100 100 300 50 200 200
                                    zoom a region
    > &storage                      query memory usage
    0
    274
    12184
    > exit                          exit the program
    %

   Input consists of blank-separated words, as shown.  If the first
word is recognized as the name of an attribute, a WAttrib() call is
made.  If it is an Icon keyword, the keyword value is printed.
Otherwise, the word is treated as a procedure name.  Any built-in
function or linked procedure can be invoked, and procedure names are
treated as case-insensitive for ease of entry.

   If a line begins with an integer, the remainder of the line is
interpreted as a command to be repeated that number of times.
Afterwards, the elapsed CPU and wall-clock time is reported;
these figures include loop and call overhead.

   The -s option selects "script" mode:  input is echoed on standard
output, and at EOF the program pauses in WDone().

[ Summary entry | Source code ]


hb.icn: Program for Hearts & Bones game

March 10, 1998; Robert J. Alexander
Requires: Version 9 graphics
This file is in the public domain.

Hearts & Bones

Usage: hb [-h <board height>] [-w <board width>] [-b <# bones>] [-B]

-B says to print the actual number of bones placed.

For best results, use odd board heights and widths, and even
square heights and widths.

Defaults: board height = 9, board width = 13, # bones = 25.

--- Game Play ---

Hit "q" to quit, "r" to start a new game.

The object is to visit all the safe squares without stepping on a
bone.

You *visit* a square by clicking the left mouse button in it.  If the
square is safe, a number is posted in it that reveals the number of
squares in the eight neighboring squares the contain bones.  Squares
containing hearts (represented by $) are always safe.

You can only visit squares that are adjacent to squares already
visited.  At the start of a game, the upper left square (a heart
square) is pre-visited for you.  If a visited square has no
neighbors, its adjacent squares are automatically visited for you, as
a convenience.

At any time you can *mark* a square that you believe has a bone by
clicking the right (or center) mouse button on it.  This is a memory
aid only -- if you visit it later (and you were right), you're dead.
There is no confirmation whether a square you have marked really
contains a bone, although you will probably find out later when it
causes you to make a mistake.  A right-button click on a marked
square unmarks it.

The game ends when you have visited all safe squares or stepped on a
bone.  (Presently, there is no automatic detection of a winning board
-- you just have to notice that for yourself).

NOTE:  If you use the command line options to alter the setup
parameters (e.g.  increasing the number of squares, or *decreasing*
the number of bones), you might get a stack overflow due, I think, to
deep recursion.  I have found that setting the environment variable
MSTKSIZE=30000 works well.

[ Summary entry | Source code ]


histo.icn: Program to display simple histogram

December 21, 2002; Ralph E. Griswold
Requires: Graphics
This file is in the public domain.

This program displays a simple histogram based on numbers provided
in standard input.

The following options are supported:

     -s r    horizontal scale factors, default 1.0
     -w i    bar width in pixels, default 5
     -g i    gap between bars, default 1
     -m      minimal; set width to 1, gap to 0.
     n s     name for image file, default "untitled"

Note: If there is too much input, there may not be resources to
open a window, and even if there is, parts may be off-screen.

The histogram is written to <name>.gif

The window is dismissed by a user q event.

[ Summary entry | Source code ]


hsvpick.icn: Program to pick RGB or HSV colors

November 14, 1994; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   hsvpick is a simple HSV color picker.  The three sliders on the
left control red, green, blue; the sliders on the right control
hue, saturation, value.  The equivalent hexadecimal specification
is displayed in the center.

[ Summary entry | Source code ]


hvc.icn: Program to pick colors for Tek HVC space

November 14, 1994; Gregg M. Townsend
Requires: Version 9 graphics under X11R5
This file is in the public domain.

   hvc is a simple color picker using HVC space.  The three sliders
control hue, value, and chroma from left to right.

[ Summary entry | Source code ]


img.icn: Program to create and edit tiny images

April 9, 2004; Gregg M. Townsend and Nolan Clayton
Requires: Version 9 graphics
This file is in the public domain.

img is a simple editor of Icon image strings and other tiny images.
An image size of 64 x 64 pixels is around the practical maximum.

usage:  img [-cn | -gn] [filename | width [height]]

-c or -g specifies a palette; the default is -c1.

An input file may contain an image string or an image readable by Icon.
If no filename is given, a new image (default size 16 x 16) is created.

img brings up a window within which:

     -- clicking on the color palette sets the color of that mouse button
     -- clicking on the cell grid sets the color of a cell
     -- shift-clicking on the cell grid sets the button color from the cell

     -- pressing "W" writes the image string to standard output
     -- pressing "Q" writes the image string and then exits
     -- pressing "Z" clears all cells to the color of the left mouse button
     -- pressing "O" or "L" toggles palette outlining or labeling
     -- pressing "T" sets the left mouse button to '~' the transparent color
     -- pressing "R" changes pixels matching the right button color
             to be the color of the left button

[ Summary entry | Source code ]


img2grid.icn: Program to convert images to grids

May 29, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts an image to a grid of cells.

The options supported are:

     -s i    size of grid cell; default 4
     -p s    save image of grid with file prefix s; default "img2grid"

[ Summary entry | Source code ]


imgcolrs.icn: Program to list colors in images

January 6, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program analyzes images whose names are given on the command line
and produces a file with the lists of colors used in each.  The entries
are given in the order of most to least frequent color.  The color
files have the base name of the image file and the extension ".clr".

[ Summary entry | Source code ]


imgpaper.icn: Program to tile images to form wallpaper

July 14, 2002; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program tiles images to fill a window.

The supported options are:

     -s      read image strings from standard input; default, use
               image file names given on command line
     -p      read BLPs from standard input; default as for -s
     -w i    window width, default 640
     -h i    window height, default 480
     -g r    gamma; default to Icon default
     -m      manual mode; wait for event before going to next image
     -a i    automatic mode (default); hold pane for i seconds, default 2
     -l      list names of files on standard output
     -i      save GIF file of each image
     -n s    prefix for image names, default "paper"
     -b      fill window with black at end and hold for event
     -v      size for video recording, 342x240; overrides other settings
     -M      mirror image before tiling

In the case of the -m option for images, if the event is a letter, the
letter, a colon, and current image name is printed to standard output.
In case of the -m option for image strings, if the event is a letter,
the image string is written.

[ Summary entry | Source code ]


imgtolst.icn: Program to convert image to list of pixel colors

November 22, 1997; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts images to lists of pixel values.  The
first line of output gives the dimensions of the image.

The extension of the image file is replaced by .lst in the list
file.

[ Summary entry | Source code ]


imlreduc.icn: Program to reduce bi-level image strings

November 21, 1996; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program reduces bi-level image strings to their lowest equivalent
form.

[ Summary entry | Source code ]


imltogif.icn: Program to convert image strings to GIF files

May 23, 1996; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts a list of image strings given in standard input
to corresponding GIF images.
____________________________________________________________

The options supported are:

     -n s    sets prefix for image file names to s, default "image"
     -c i    number of columns for serial numbers in file names;
               default 4
     -f i    first number, default 1
     -p      treats image string as a pattern and fills a square
                window of its maximum dimension

[ Summary entry | Source code ]


ims2pat.icn: Program to convert image string to bi-level pattern

April 20, 2000; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts an image string with the g2 palette to a
bi-level pattern.

[ Summary entry | Source code ]


imstogif.icn: Program to convert image strings to GIF files

June 23, 2000; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program converts image strings whose names are given on the command
line to GIF files.  Image files are expected to have the suffix .ims.

The GIF files are written to files with the basenames of the image string
files and the suffix "gif".

The following option is supported:

     -l      read Icon literal instead of plain string

[ Summary entry | Source code ]


ipicker.icn: Program to print name of selected images

August 13, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays images listed on the command line and waits for
user input typed into the wnodw.  If the input is the letter "y",
the name of the image file is written to standard output.  If the
input is "q", the program terminates.  Other input is ignored.

[ Summary entry | Source code ]


isd2disd.icn: Program to show convert ISD draft to drawdown form

November 1, 2001; Ralph E. Griswold
This file is in the public domain.

This program converts an ISD to an ISD with drawdown colors.

[ Summary entry | Source code ]


isd2gif.icn: Program to create woven image from ISD

May 23, 2002; Ralph E. Griswold
This file is in the public domain.

This program reads a internal structure draft and creates a GIF image of
the corresponding weave.  The command-line option

     -n s

allows the basename for the GIF file to be specified.  Otherwise, it
is take from the name field of the ISD. If other command-line arguments
are given, they are used as attributes for the window in which the
woven image is created.

[ Summary entry | Source code ]


isd2grid.icn: Program to create grid plots for ISDs

May 25, 2002; Ralph E. Griswold
Requires: Version 9 graphics and large integers
This file is in the public domain.

NOTE:  The drawdown code is patched in from code in pfd2ill.icn and
uses a different method than the others.  One way or another, the
methods should be made consonant.

The option -n s allows a basename to be specified for the image file.
It defaults to the name in the ISD.
____________________________________________________________

Note:  The include file may contain link declarations.

[ Summary entry | Source code ]


isd2ill.icn: Program to create images from ISDs

April 23, 2000; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program creates Encapsulated PostScript and GIF image files from
ISDs.

The following options are supported:

     -g      draw grid lines on drawdown
     -h      hold windows open in visible (-v) mode
     -p      add showpage for printing
     -s i    cell size, default 6
     -v      show images during creation; default, don't

Other options to be added include the control of layout and orientation.

Names of ISDs are taken from the command line.  For each, six Encap-
PostScript files are created:

     <base name>_tieup.eps (if given)
     <base name>_liftplan.eps (if given)
     <base name>_threading.eps
     <base name>_treadling.eps
     <base name>_drawdown.eps
     <base name>_pattern.eps (colored "drawdown")

Corresponding GIFs also are produced.

Future plans call for handling "shaftplans" specifying what diagrams
are wanted.

[ Summary entry | Source code ]


isd2wif.icn: Program to produce WIF from ISD

April 14, 2002; Ralph E. Griswold
This file is in the public domain.

This program produces a WIF from an ISD.

[ Summary entry | Source code ]


isd2xgrid.icn: Program to create grid plots for ISDs

July 4, 2002; Ralph E. Griswold
Requires: Version 9 graphics and large integers

NOTE:  The drawdown code is patched in from code in pfd2ill.icn and
uses a different method than the others.  One way or another, the
methods should be made consonant.

The option -n s allows a basename to be specified for the image file.
It defaults to the name in the ISD.

This version is for ISDs without explicit thread-color information.
____________________________________________________________

Note:  The include file may contain link declarations.

[ Summary entry | Source code ]


iview.icn: Program to display image files

January 22, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program is modeled after the Unix xview(1) utility.  It takes
a list of image files on the command line and displays them in
order.  The character "n" typed when the mouse cursor is in the
image window goes to the next image.  The character "q" terminates
the display.

This program can, of course, only display image types that Icon
understands.

[ Summary entry | Source code ]


julia1.icn: Program to display the Julia set

June 17, 1994; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This is a barebones version of a display of the Julia set.  It
has deliberately been left simple and free of options so that the
basic idea is clear and so that it can be used as the basis of
more capable versions.

This program is based on material given in "Chaos, Fractals,
and Dynamics", Robert L. Devaney, Addison-Wesley, 1990.

The point in the complex plane for which the Julia set is computed
is given on the command line, as in

     julia1 .360284 .100376

which displays the Julia set for the complex number .360284 + .100376i.

[ Summary entry | Source code ]


kaleid.icn: Program to produce kaleidoscope

May 2, 2001; Stephen B. Wampler
Requires: Version 9 graphics
This file is in the public domain.

   Lots of options, most easily set by with the interface after
   startup.  The only one that isn't set that way is -wn where 'n' is
   the size of the kaleidoscope window (default is 600 square).

   Terminology (and options):

      Window_size (-wN): How big of a display window to use.
          At the current time, this can only be set via a
          command line argument.

      Density (-dN): How many circles per octant to keep on display
          at any one time.  There is NO LIMIT to the density.

      Duration (-lN): How long to keep drawing circles (measured in
          in circles) once the density is reached.  There is NO LIMIT
          to the duration.

      MaxRadius (-MN): Maximum radius of any circle.

      MinRadius (-mN): Preferred minimum radius.  Circles with centers
          near the edge have their radii forced down to fit entirely
          on the display

      MaxOffset (-XN): Maximum offset from center of display (may wrap).

      MinOffset (-xN): Minimum offset

      Skew (-sN): Shift probability of placing a circle at a 'typical'
          offset.

      Fill (-F): Turns off filling the circles.

      Clear (-C): After the duration, reduces density back to 0 before
          quitting.

      Random Seed: (-rN): Sets the random number seed.

Thanks to Jon Lipp for help on using vidgets, and to Mary Camaron
  for her Interface Builder.

[ Summary entry | Source code ]


kaleido.icn: Program to produce kaleidoscopic display

February 16, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays kaleidoscopic images.  The controls on the
user interface are relatively intuitive -- trying them will give
a better idea of what's possible than a prose description here.

This program is based on an earlier one by Steve Wampler, which in
turn was based on a C program by Lorraine Callahan.

[ Summary entry | Source code ]


keypunch.icn: Program to simulate a keypunch

February 7, 1995; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

   In the olden days, computer data was encoded by rectangular holes
punched in thin pieces of cardboard about the size of an old dollar.
This program simulates a "keypunch", a mechanical device for punching
those holes.  (Keypunches themselves were programmable, but there's
no way to program this one; tab stops are set permanently.)

   A carriage return feeds a new card.  Illegal characters punch a
lace column.  As with a real keypunch, you can backspace, but the
holes don't go away.

   The shift key turns "UIOJKLM<>" into "123456789".  The meta key
serves (imperfectly) as the multipunch key.

   The font was chosen on a Sun workstation and may not be portable.

[ Summary entry | Source code ]


koch.icn: Program to demonstrate Koch curves

October 14, 1992; Stephen B. Wampler
Requires: Version 9 graphics and co-expressions (for glib.icn)
This file is in the public domain.

Comments: This program shows how Koch curves work.

    See the procedure 'helpmsg' for command line options

    Waits for a window event before closing window

[ Summary entry | Source code ]


lindcomp.icn: Program to compile 0L-systems

August 13, 1995; Ralph E. Griswold
See also: linden.icn
This file is in the public domain.

This program converts a 0L-system to an Icon program, which when
executed, produces the corresponding drawing.

[ Summary entry | Source code ]


linden.icn: Program to generate sentences in 0L-systems

June 21, 1999; Ralph E. Griswold
Requires: graphics if drawing
This file is in the public domain.

This program reads in a 0L-system (Lindenmayer system) consisting of
rewriting rules in which a string is rewritten with every character
replaced simultaneously (conceptually) by a specified string of
symbols.

Rules have the form

     S->SSS...

where S is a character.

In addition to rules, there are keywords that describe the system and how
to draw it.  These include the "axiom" on which rewriting is started and
optionally the angle in degrees between successive lines (default 90).
Other keywords may be present, but are ignored.

Keywords are followed by a colon.

  An example 0L-system is:

     X->-FX++FY-
     Y->+FX--FY+
     F->
     -->-
     +->+
     axiom:FX
     angle:45.0
     xorg:100
     yorg:100

Here, the initial string is "FX" and angular increment is 45 degrees.
Note that "-" is a legal character in a 0L-system -- context determines
whether it's 0L character or part of the "->" that stands for "is
replaced by".

If no rule is provided for a character, the character is not changed
by rewriting. Thus, the example above can be expressed more concisely
as

     X->-FX++FY-
     Y->+FX--FY+
     F->
     axiom:FX
     angle:45.0

The recognized keywords are:

     axiom   axiom for generation
     angle   angular increment for turns
     length  segment length
     xorg    x origin
     yorg    y origin
     comment comment; ignored

Distances increase from left to right in the x direction and from top
to bottom in the y direction.

As pure-production systems, the characters are symbolic and have no
meaning.  When interpreted for drawing, the characters have the
following meaning:

     F       move forward by length
     f       move backward by length
     +       turn right by angle
     -       turn left by angle
     [       save current state
     ]       restore current state

The file containing the 0L-systems is read from standard input.

The command-line options are:

     -g i    number of generations, default 3
     -l i    length of line segments, default 5
     -a i    angular increment in degrees (overrides angle given in
               the grammar)
     -w i    window width
     -h i    window height
     -x i    initial x position, default mid-window
     -y i    initial y position, default mid-window
     -W      write out string instead of drawing
     -s      take snapshot of image.
     -d i    delay in milliseconds between symbol interpretations;
               default 0

NOTE:  The name option that supported multiple L-Systems in
       one file has been eliminated on the grounds that it
       introduced too much complexity in use.
____________________________________________________________

References:

   Formal Languages, Arto Salomaa, Academic Press, 1973. pp. 234-252.

   The Algorithmic Beauty of Plants, Przemyslaw Prusinkiewicz and
   Aristid Lindenmayer, Springer Verlag, 1990.

   Lindenmayer Systems, Fractals, and Plants, Przemyslaw Prusinkiewicz and
   James Hanan, Springer Verlag, 1989.
____________________________________________________________

See linden.dat for an example of input data.

[ Summary entry | Source code ]


lorenz.icn: Program to display Lorenz strange attractor

December 5, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This is a barebones version of a display of the Lorenz strange
attractor.  It has deliberately been left simple and free of options so
that the basic idea is clear and so that it can be used as the basis of
more capable versions.

This program is based on material given in "Fractal, Programming in
Turbo Pascal", Roger T. Stevens, M&T Books, 1990.

[ Summary entry | Source code ]


lsys.icn: Program to experiment with Lindenmayer systems

June 17, 1994; Stephen B. Wampler
Requires: Version 9 graphics and co-expressions (for glib.icn)
This file is in the public domain.

Comments: This program display Lindenmayer systems using
    turtle graphics.  There are some built-in L-systems,
    but users can easily modify these and construct new
    systems.

    See the procedure 'helpmsg' for command line options
    (or run as 'lsys -help')

    Waits for a window event before closing window

[ Summary entry | Source code ]


mandala.icn: Program to draw mandala design

September 13, 1997; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program draws "mandala" patterns.

The following options are supported:

     -g      run continuously; ignore user events; default: process user
               events
     -l i    limit on number of iterations, default 2 ^ 10
     -n i    maximum number of points, default 50
     -s i    size of window (width/height); default 256

[ Summary entry | Source code ]


mandel1.icn: Program to display the Mandelbrot set

June 17, 1994; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This is a barebones version of a display of the Mandelbrot set.  It
has deliberately been left simple and free of options so that the
basic idea is clear and so that it can be used as the basis of
more capable versions.

This program is based on material given in "Chaos, Fractals,
and Dynamics", Robert L. Devaney, Addison-Wesley, 1990.

[ Summary entry | Source code ]


mandel2.icn: Program to draw the Mandelbrot set

June 17, 1994; Roger Hare
Requires: Version 9 graphics
This file is in the public domain.

This program draws portions of the Mandelbrot set according to the values
input # on the command line. The method is that described in the articles by
Dewdney # in the Computer Recreations column of Scientific American in August
'85, # October '87 and February '89.

I have problems with colours (not enough of 'em!), so I have used alternated
black and white. Those with decent X-terminals will be able to do far
better than me.

The program certainly doesn't display images as striking as those seen
in publications. Perhaps the scaling of the value of k needs to be
different? All suggestions gratefully received.

It is possible to speed things up by displaying the points row by row
rather than randomly, but as the program is resident in the 100 cycle
iteration most of the time, this is only ~5% speed-up. Not really
worth it.

One of Dewdney's articles mentions other methods to speed things up - I
will search out the algorithms one of these days...

Usage is - xmand startr startc size n &

where:

startr, startc are the co-ordinates of the lower left hand corner of the
 area of the complex plane to be displayed
size is the size of the (square) area of the complex plane to be displayed
n is the number of pixels into which size is to be divided for display
 purposes

For example - xmand -1.5 -1.25 2.5 400 &

will display the Mandelbrot set in the 2.5x2.5 region of the complex plane
whose s-w corner is -1.5-i1.25. The display will be 400x400 pixels.

The program has been tested on a Sun 4 using the Icon compiler, and
on a Sequent Symmetry running Version 5 Unix using both the
compiler and translator.

[ Summary entry | Source code ]


mercator.icn: Program to display surface of HLS color cones

July 23, 1998; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  mercator [window options] [palette]

   Mercator displays the surface of the HLS color space (hue,
lightness, saturation) in something approximating a Mercator
projection.   The white pole is at the top, the black pole is
at the bottom, and the fully saturated colors run along the
central equator.

   Colors are usually quantized to one of Icon's color palettes,
with the "c1" palette being the default.  Specifying a palette
of "none" inhibits quantization, generally leading to poor results
due to color allocation failure.
____________________________________________________________

   Calling this a mercator projection is not exactly correct.
The first problem is that HLS space is a double cone, not a
sphere, but that can be disregarded by mapping hue to longitude
and lightness to latitude.  Even so, the projection is not truly
a Mercator projection, but rather another member of the cylindrical
family:  a rectangular, or equidistant cylindrical, projection.

[ Summary entry | Source code ]


mirroror.icn: Program to mirror images given on command line

February 2, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

To get from one image to another, type "n"; to quit, type "q". "s"
produces a snapshot and "w" writes the name of the file.

[ Summary entry | Source code ]


moire.icn: Program to display Moire patterns

May 2, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays moire patterns.

The following options are supported:

     -g      run continuously; ignore user events; default: process user
               events
     -i i    initial size, default 50
     -k i    increment, default 1
     -l i    limit on number of iterations, default 2 ^ 10
     -p s    palette, default "c2"
     -s i    size of window (width/height); default 256

This program is based on material given in "FractalVision",
Dick Oliver, Sams Publishing, 1992, pp. 185-190.

[ Summary entry | Source code ]


mover.icn: Program to move files from one name to another

January 29, 1997; Ralph E. Griswold
Requires: UNIX
This file is in the public domain.

Program to allow interactive moving (renaming) of files.

[ Summary entry | Source code ]


offtiler.icn: Program to tile images with offset

March 14, 1998; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program produces drop repeats and brick patterns.

[ Summary entry | Source code ]


orbit.icn: Program to display quadratic orbit

June 17, 1994; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This is a barebones version of a display of the orbit of a quadratic
equation.  It has deliberately been left simple and free of options so
that the basic idea is clear and so that it can be used as the basis of
more capable versions.

This program is based on material given in "Chaos, Fractals,
and Dynamics", Robert L. Devaney, Addison-Wesley, 1990.

[ Summary entry | Source code ]


painterc.icn: Program to convert Painter color sets to Icon colors

January 6, 1995; Ralph E. Griswold
This file is in the public domain.

This program converts color sets from Painter 3 to lists of Icon
colors.

The lists are saved in files with the base name of the color set and
the suffix ".clr".

[ Summary entry | Source code ]


palcheck.icn: Program to check palindromic sentences

August 14, 1996; K'vin D'vries and Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program reads lines from standard input.  If a line is a
palindromic sentence (see The Icon Programming Language, 2nd edition,
p. 58), it is ignored.  If it is not a palindromic sentence, it is
written to a window with the outermost characters that don't match
highlighted.

[ Summary entry | Source code ]


palette.icn: Program to display an Icon image palette

May 23, 1996; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  palette [name]

Palette displays each color available in an image palette along with its
index character.  The default palette is "c1".

Typing a digit (1 to 6) in the window switches the display to the
corresponding color palette.  Typing a "g" selects the "g16" palette.

Typing "l", "o", or "u" toggles the respective drawpalette() flag.

The window can be resized.

[ Summary entry | Source code ]


pat2gif.icn: Program to convert bi-level pattern to GIF

November 30, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

Names ofs BLP are given on the command line.  The GIFs have a
corresponding basename.

[ Summary entry | Source code ]


patfetch.icn: Program to extract patterns from a file

July 22, 1993; Ralph E. Griswold
This file is in the public domain.

This program accepts a list of integer specifications for patterns
as the appear in order in a file of patterns.  The selected patterns
are written to standard output, but not until the end of the input
specifications.  The name of the pattern file is specified on the
command line.

Each line of input can be a comma-separated string of either integers
or integer ranges.  Blanks after commas are tolerated.  An example of
input is:

     1-3, 5
     10
     13-17
     8

which specifies the patterns 1, 2, 3, 5, 8, 10, 13, 14, 15, 16, and 17.

Note that the integers need not be in order, although within a range,
the lower bound must precede the upper bound.

[ Summary entry | Source code ]


penelope.icn: Program to edit graphic patterns

May 25, 2001; Ralph E. Griswold and Gregg M. Townsend
Requires: Version 9 graphics with 32-column tiles
This file is in the public domain.

This application provides a variety of facilities for creating and
editing graphic pattern specifications.  For a complete description,
see IPD234:
     http://www.cs.arizona.edu/icon/docs/ipd234.htm

[ Summary entry | Source code ]


pextract.icn: Program to separate good and bad patterns

September 1, 1993; Ralph E. Griswold
This file is in the public domain.

This program takes the name of a file containing tile specifications
on the command line.   Tiles to be extracted are entered from standard
input.  Extracted tiles are written to standard output.

Options:

     -b              replace selected tiles by blank tiles
     -d              delete selected tiles from specification file
     -c              copy selected tiles, do not blank or delete
                       them.  This is the default; -c overrides
                       -b and -d.

[ Summary entry | Source code ]


pgmtoims.icn: Program to make an image from a PGM file

May 23, 1996; Gregg M. Townsend
Requires: Version 9 graphics
This file is in the public domain.

Usage:  pgmtoims [-gn] [file]

Pgmtoims reads a PGM rawbits file and writes an Icon image string.
The "-gn" option (2 <= n <= 64) selects the palette; g41 is the
default.

Note that only rawbits-format PGM files can be read.

[ Summary entry | Source code ]


picktile.icn: Program to pick a tile out of an image

May 2, 2001; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program provides an optionally magnified view of an image file.
Clicking on a pixel produces a pattern specification for the tile
with the selected upper-left corner.

Options are:

     -z i    zoom factor, default 1 (no magnification)
     -f      use fixed size tiles rather than selection; default selection
     -w i    width of tile, default 32
     -h i    height of tile, default width
     -I      pick tiles to make icons; implies -z2, -f, -w38, -w38 (the
               larger size leaves room for error and trimming)
     -R i    specs for ResEdit files; i = 32 or 16
     -t      trim whitepace around tile

Typical usage is

     picktile image.xbm >image.tle

The program terminates if "q" is pressed when in the image window.

[ Summary entry | Source code ]


plat.icn: Program to create image file with specified colors

January 6, 1995; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program produces image files from color lists, in which the
image file contains one pixel for each color.  The image files are
16x16 pixels.  If a color list has less than 256 colors, the rest
of the image is black.  If the color list has more than 256 colors
only the first 256 are processed.

The image file names have the basename of the color list files followed
by _p and the suffix .gif.

[ Summary entry | Source code ]


plotter.icn: Program to display planes of 3-space coordinates

July 22, 1997; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program plots planes for coordinates in 3-space.

[ Summary entry | Source code ]


pme.icn: Program to edit pixmaps

April 30, 2001; Clinton L. Jeffery
Requires: Version 9 graphics
This file is in the public domain.

    A (color) pixmap editor.

    Left, middle, and right buttons draw different colors.
Press q or ESC to quit; press s to save.  Capital "S" prompts for
and saves under a new filename.
Click on the little picture of the mouse to change one of the
button's colors.  Not very interesting on a monochrome server.

[ Summary entry | Source code ]


poller.icn: Program to record image as pixel coordinates

December 30, 1998; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program reads an image whose name is given on the command line and
writes it out as an Icon list of pixels in the form of an include file.
See the documentation below for details.

[ Summary entry | Source code ]


procater.icn: Program to display concatenation sizes

September 18, 1996; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays successive numbers by lines of corresponding
height.  When the display area is full, it scrolls from right to
left.

In this version, input is piped in.

[ Summary entry | Source code ]


profile.icn: Program to display scrolling histogram

January 21, 1999; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays successive numbers by lines of corresponding
height.  When the display area is full, it scrolls from right to
left.

If a line has a number followed by a blank and a string, the string
is interpreted as a color.

[ Summary entry | Source code ]


profiler.icn: Program to display number magnitudes

November 21, 1996; Ralph E. Griswold
Requires: Version 9 graphics
This file is in the public domain.

This program displays successive numbers by lines of corresponding
heigh