View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Dmitry Karasik > Prima-IPA-1.09 > iterm


Annotate this POD


Open  1
View/Report Bugs


iterm - the interactive tool for Prima::IPA library


iterm is a mostly command-line tool for basic image processing. It has terminal representation, where the main window is capable of viewing the image and accepting commands. The command syntax is pure perl, plus all functions available in the Prima::IPA library ( see Prima::IPA ) and Prima toolkit ( see Prima), and some specific iterm commands.



iterm defines several scalars for the user needs. The main window shows the content of the scalar $i, if it is an image. If the additional windows are opened, they correspond to images in array @i. The array @i is filled automatically, and the index is shown on the additional new window titles. The additional windows are stored in array @windows, under same indexes. The main window is stored in scalar $w.

The input line is used to enter perl code. If the code returns and newly created image, it is stored into $i, and the old value of $i is discarded. If the code returns more than on image, the additional windows opened automatically. If the code throws an exception, its first line is shown on the status line, and the whole message is printed to stderr.

To see pixel value under mouse cursor, hold the Shift key.

Interactive commands

There are several interactive commands, present on the window menus.

The main and the additional windows have different sets of interactive commands.


Presents a file selection dialog, where the image file is to be selected and its content loaded into variable $i and displayed in the main window.

Save as

Opens a file save dialog, where the content of $i can be stored on disk.


Creates a new additional window and copies $i into it. The newly created image is stored into @i array, and the new window into @windows array. The indexes of these are equal and shown on the window's title.


Note: only for additional windows

Copies the content of the image into $i


Note: only for additional windows

Copies content of $i into the image.

iterm commands

These are commands, specific to iterm.

new VAR

Assigns new variable $VAR to an empty image

show IMAGE

Assigns IMAGE to $i and displays it.


Flushes the command history

load FILE [ options ]

Loads image FILE into $i and displays the image. FILE must be a quoted string.

reverse IMAGE

Reverses image

stretch IMAGE

Stretches image data to fit the whole range. For the histogram equalization see Prima::IPA::Point::equalize

save IMAGE, FILE [ options ]

Stores IMAGE object into FILE.


Exits iterm.

zoom SCALE

Selects zoom for window $w. There are no shortcuts for selecting zoom for the additional windows, but this can be achieved by entering the following code:

   $windows[$NUM]-> Image-> zoom($SCALE)

Opens a new, empty additional window.


See Duplicate


Reverts $i to its last value


Declare lexical VARIABLE and assign VALUE to it.


To load an image:

   load 'image.gif'

Convert to 8-bit grayscale:

   $i-> type( im::Byte)

Perform dilation:

   dilate $i

Copy to new window


Erode the new image

   erode $i[0]

Display the difference

   subtract $i, $i[0]

Note: iterm never asks if the changed images are to be saved.


~/.iterm-list - the command history



Dmitry Karasik <>

syntax highlighting: