[Creating procedures...] [Table of Contents]

Getting started and Basic Operations on Images


Since Rivl is an extension of Tcl, Rivl programs have access to all the primitives of the Tcl language. Rivl extends Tcl with two data types: images, which represent still images, and sequences, which represent video segments (a time-stamped set of images). In this section we will look at the basics of using image effects.

  • The first step is to start up the Rivl-envornment with tcl-rvl.
  • Once you're in the Rivl-environment the first step is to read in the image file which you wish to apply the effect to. This is done with im_read. The image file can be a PPM, PGM or JPEG file. An example of reading in an image file would be: im_read tiger.pgm. Rivl will the return a "handle" which is sort of a reference to that specific file. This "handle" is what you will use whenever referring to your image file.
  • The next step is applying the effect to the image file. This is done with any of the commands under IMAGE TRANSFORMS, for instance im_rotateC. Here's an example: im_rotateC rivl_image1 90. "rivl_image1" is the handle that was returned when you read in the image file. Now a new "handle" will be returned, one which refers to the image with the image transform applied to it. For specific information on syntax for the different types of effects, see the individual pages under IMAGE TRANSFORMS.
  • Finally you will want to save the new image to file. This is done with im_write. An example of writing an image to a file would be: im_write rivl_image2 rotated_tiger.pgm.

    In the end, you will have something that looks like this: