Printing an Image

Summary:


Contents of This Section


Return to SAOtng Summary User's Guide

Printing an Image

A Postscript representation of the currently displayed image can be generated using the Print Image option of the File menu. Print Image brings up a dialog box, into which a print directive can be entered. Enter a carriage return in the dialog box or click on the OK button to generate PostScript output. The SAOtng print command works sending the current colormap (as a list of ASCII RGB 3-tuples) and an 8-bit FITS representation of the displayed image (the "scaled" data) to the fits2ps program. This program outputs a PostScript representation of the image to its standard output. The print directive is then used to redirect the PostScript to the appropriate place. Note that fits2ps can be run stand-alone. The command:

    cat [foo.fits] | fits2ps -luts [colormap]
will generate a PostScript image from the input FITS file and colormap. The FITS file must have BITPIX=8, i.e., it must be an 8-bit image.

Print Directives

The print directive allows the PostScript representation of an image to be sent to a variety of places, including printers, disk files, and programs such as ghostview. To send PostScript to a printer, use the directive:

    lpr [print options]
e.g.
    lpr -Ppscolor

To display the PostScript image in ghostview, use the directive:

    ghostview [ghostview options]
If ghostview is specified without any options, the "-" option (take the input from stdin) is assumed. Otherwise, if you wish to add options to ghostview, you also must specify the "-" option explicitly:
    ghostview -monochrome -

PostScript also can be saved in a disk file by using the print directive:

    > [filename]
e.g.
    > foo.ps
More generally, the print directive be thought of as the back-end of a Unix pile-line that is receiving the PostScript image to its standard input. Thus, any command of the form:
    | [Unix command]
or
    > [Unix command]
can be used as a print directive. For example, you can print the PostScript and save it to disk simultaneously with the directive:
    | tee foo.ps | lpr -Ppscolor
Note that the "lpr" and "ghostview" directives are handled specially: the "|" symbol is added automatically as a convenience to the user.

When a file is printed, the print command being used is output to SAOtng's stdout, so that users can verify that the correct operation is being performed.


Return to Main SAOtng Help Page
Last Updated May 1, 1995