man(1) Manual page archive


     PICO(1)                                                   PICO(1)

     NAME
          pico - graphics editor

     SYNOPSIS
          pico [ -mfto ] [ -wN -hN ] [ files ]

     DESCRIPTION
          Pico is an interactive editor for grey-scale and color
          images.  Editing operations are expressed in a C-like style.
          The options are

          -mn    Display on a Metheus frame buffer, /dev/omn.  A miss-
                 ing n is taken to be 0.

          -f     Display on an Itoh frame buffer, /dev/iti0.

          -t     Show parse trees for expressions; toggled by the
                 interactive command `tree'.

          -o     Turn off the optimizer; toggled by `optim'.

          Files are referred to in expressions as $n, where n is the
          basename or an integer, see f below.  Otherwise file names
          are given as strings in double quotes, which may be elided
          from names that do not contain `/'.

          In general, the result of the previous edit operation is
          available under the name `old'.  The destination of the cur-
          rent operation is called `new'.

          Pico handles images with coordinates (0,0) in the upper left
          hand corner and (X,Y) in the lower right.  Brightnesses
          range from 0 (black) to Z (white, Z=255).  The quantities
          X,Y,Z may be used in expressions and set by options:

          -w n   Set the width X of the work area to n pixels, default
                 511.

          -h n   Set the height Y, default 511.

          Pico reads commands from the standard input:

          help Give a synopsis of commands and functions.

          a file
          a x y w d file
               Attach a new file.  Optional parameters x and y give
               the origin of a subrectangle in the work buffer; w and
               d define width and depth of the image as stored in the
               file.

     PICO(1)                                                   PICO(1)

          d file
          d $n Delete (close) the file.

          h file
               Read header information from the file.

          r file
               Read commands from file as if they were typed on the
               terminal.  Can not be done recursively.

          w file
          w - file
               Write the file, restricted to the current window (see
               below).  Use pico format by default.  With a minus
               flag, write a headerless image (red channel only, if
               picture is colored); see also picfile(5).

          nocolor
          color
               Set the number of channels updated in the work buffer
               to 1 (black and white) or 3 (red, green, blue).

          window x y w d
               Restrict the work area to a portion of the work buffer
               with the upper left corner at (x,y), and the lower
               right at (x+w,y+d).

          get file
          get $n
               The picture file is (re)opened and read into the work
               area.

          f    Show names, sizes, and file numbers of open files.

          faster
          slower
               In slow display the screen is updated once per pixel
               computed; in fast display (default), once per line of
               pixels.

          show name
               Show symbol table information, such as the current
               value of variables.  If name is omitted, the whole sym-
               bol table is shown.

          functions
               Print information on all user defined and builtin func-
               tions.

          def name ( args ) { program }
               Define a function, with optional arguments.  Variables
               are declared in these styles:

     PICO(1)                                                   PICO(1)

               int var;
               global int var;
               array var[N];
               global array var[N];

          x expr
               Execute the expression in a default loop over all pix-
               els in the current window.

          x {program }
               Execute the program. The program must define its own
               control flow.

          q    Quit.

     EXAMPLES
          `pico -w1280 -h1024 -m5'
               Get a work buffer that exactly fills a Metheus screen.

          a "/tmp/images/rob"
               Make a file accessible.  It will be known henceforth as
               `$rob'.

          `a 1280 0 3072 512 junk'
          `get $junk'
               Direct attention to a 512×512 subrectangle in the mid-
               dle of a 3072×512 image stored in a file named junk,
               and read it into the workspace.
          x new = Z - old
          x new[x,y] = Z - old[x,y]
          x {for(x=0; x<=X; x++) for(y=0; y<=Y; y++) new[x,y] = Z-old[x,y];}
               Three ways to make a negative image.  Note the defaults
               on control flow and array indexing.

          window 0 0 256 256
          x new = $1[xclamp(x*2), yclamp(y*2)]
               Scale a 512×512 image to one quarter of the screen.
               The built-in functions `xclamp' and `yclamp' guard
               against indexing out of range.

          x { printf("current value of %s[%d]:\t%d\n", "histo", 128, hist[128]); }
               Turn off the default control flow (curly braces) and
               use the builtin function printf to check the value of
               an array element.

     SEE ALSO
          bcp(1), imscan(1), flicks(9.1), rebecca(9.1), picfile(5),
          flickfile(9.5)
          G. J. Holzmann, `PICO Tutorial', this manual, Volume 2
          G. J. Holzmann, Beyond Photography-the Digital Darkroom,
          Prentice-Hall, 1988