|[<--] [Cover] [Table of Contents] [Concept Index] [Program Index] [-->]|
As with text, there are tools for both viewing and editing images. This chapter describes the various methods for viewing images; the editing of images is discussed in the next chapter). While you can view an image with an image editor, it is safer (and faster!) to view with a viewer when you do not intend to edit it.
The DVI ("DeVice Independent"), PostScript, and PDF ("Portable Document Format") file formats can be generated by a number of applications. They are graphical image formats commonly used for printing; methods for previewing these files on the display screen are discussed in the following sections.
xdvi tool to preview a DVI file in X. Give the name of
the file to preview as an argument.
xdvi will show how the
document will look when printed, and let you view it at different
$ xdvi gentle.dvi [RET]
To magnify the view of the document, left-click any of the buttons
labelled with a percentage, such as
17%; they magnify the view by
The following table lists some of
|| Exit |
||Advance to the next page.|
||Move to previous page.|
||Same as [Q].|
||Same as [Q].|
||Same as [N].|
||Redisplay the current page.|
||Re-read the DVI file.|
Debian: `ghostview' Debian: `gv' WWW: http://wwwthep.physik.uni-mainz.de/~plass/gv/
To preview a PostScript or EPS image file in X, use
takes a file name as an argument, and it previews the contents of the
file in a window, starting with its first page.
$ ghostview /usr/doc/gs/examples/tiger.ps [RET]
Press [Q] to exit and press [SPC] to advance to the next page, if there is one.
NOTE: Some people prefer the
gv tool as an alternate to
gv is used in much the same way, though it has
a different interface.
Debian: `xpdf' WWW: http://www.foolabs.com/xpdf/ Debian: `gv' WWW: http://wwwthep.physik.uni-mainz.de/~plass/gv/
xpdf to preview a PDF file. Give the name of the PDF file to
preview as an argument.
$ xpdf flyer.pdf [RET]
xpdf, press [Q]; use the two magnifying-glass buttons
to zoom the view closer in (
+) or further out (
-), and use
the left and right arrow buttons to move to the previous and next pages,
NOTE: You can also use
gv to preview PDF files.
Debian: `imagemagick' WWW: ftp://ftp.wizards.dupont.com/pub/ImageMagick/
To view an image in X, use
display, part of the ImageMagick suite
of tools. It can recognize many image formats, including FlashPix,
GIF/GIF87, Group 3 faxes, JPEG, PBM/PNM/PPM, PhotoCD, TGA, TIFF,
TransFig, and XBM.
display takes as an argument the file name of the image to be
viewed, and it displays the image in a new window.
$ display sailboat.jpeg [RET]
This command displays the image file in a new window:
The mouse buttons have special meaning in
display. Left-click on
the image window to open the
display command menu in a new
display command menu looks like this:
Menu items let you change the image size and otherwise change or
transform the image display. Choose
Overview from the
menu for an explanation of the various available
Middle-click on the image to open a new window with a magnified view of the image centered where you click. For example, middle-clicking on the sailboat image in the previous example will open a new window that looks like this:
Finally, right-click on the image window for a pop-up menu containing a
few of the most frequently-used commands; to choose one of these
commands, drag the mouse pointer over the command. Commands in the
pop-up menu include
Quit, which exits
display, and the
Image Info, which displays information about the image file
itself, including number of colors, image depth, and resolution.
The following table describes some of the keyboard commands that work
when displaying an image in
||Display the next image specified on the command line.|
||Display the previous image specified on the command line.|
|| Quit displaying the image and exit |
||Write the image to a file.|
||Halve the image size.|
||Double the image size.|
||Return the image to its original size.|
||Rotate image 90 degrees clockwise.|
||Rotate image 90 degrees counter-clockwise.|
||Open a new window with information about the image, including resolution, color depth, format, and comments, if any.|
||Toggle a horizontal mirror image.|
||Toggle a vertical mirror image.|
displaycan also be used to view images on the World Wide Web -- see Viewing an Image from the Web.
display tool offers a feature for browsing a collection of
images -- give `vid:' as the file argument, followed by the file
names or pattern to match them in quotes.
thumbnails of the specified images, and displays them in a new window,
which it calls a visual image directory.
$ display 'vid:/usr/doc/imagemagick/examples/*.gif' [RET]
$ display 'vid:*' [RET]
In the preceding example, only those files with image formats
display are read and displayed.
NOTE: To open an image at its normal size, right-click the
image and choose
Load; the thumbnail will be replaced by its
full-size image. To return to the thumbnail directory, right-click the
image and choose
One way to put an image in the root window (the background behind all
other windows) is to use
display and give `root' as an
argument to the `-window' option.
$ display -window root tetra.jpeg [RET]
zgv to view images in a virtual console (not in X). You can
zgv to browse through the filesystem and select images to
view, or give as arguments the names of image files to view. It
recognizes many image formats, including GIF, JPEG, PNG, PBM/PNM/PPM,
TGA and PCX; one of its nicest features is that it can fill the entire
screen with an image.
When you run
zgv with no options, it displays image icons of any
images in the current directory, listing any subdirectories as folder
icons. You can also give the name of a directory as an argument in order
to browse the images in that directory.
$ zgv [RET]
$ zgv /usr/share/gimp/scripts [RET]
Use the arrow keys to navigate through the file display; the red border around a image or directory icon indicates which image or subdirectory is selected. Type [RET] to view the selected image or to change to the selected directory.
You can manipulate the images you view in a number of ways -- zoom the
image magnification in and out, change the brightness and color, and
even make automatic "slide shows" of images. The following table
describes some of
||Toggle image centering. Images are centered on screen by default; specifying this option turns off centering.|
||Ignore errors due to corrupted files, and display whatever portion of the file is displayable.|
|| Start |
||Toggle mouse support. Mouse support is off by default; this option turns it on.|
||Reread and redisplay every image after every integer seconds. Useful for viewing webcam images or other image files that are continuously changing.|
If you have a graphical Web browser, such as
mozilla, you can use
it to view a graphic image. While viewing images in a browser doesn't
offer much flexibility (you can't zoom in on a portion of the image, or
get information about the image resolution and other details), if you
simply want to quickly view an image file while you are in X, and you
have a Web browser running, it can be a quick and easy way to do it.
To view an image file in a Web browser, specify a file: URL
pointing to the file name of the image in the
Location field of
Notice that the given file: URL only has one preceding slash, pointing to the root directory, and not two, as in http://.
Debian: `xpcd' Debian: `xpcd-gimp' WWW: http://user.cs.tu-berlin.de/~kraxel/linux/xpcd/
xpcd tool is an X client for viewing and browsing collections
of Kodak PhotoCD images. To browse the images on a Kodak PhotoCD, mount
the CD-ROM (see Mounting a CD-ROM), and then give
the mount point as an argument to
$ xpcd /cdrom [RET]
The preceding example will open two new windows -- a small
command bar window, and a larger window containing thumbnails of all
PhotoCD images on the disc.
To open a copy of an image in a new window, left-click its thumbnail
image. When you do,
xpcd will open the image at the
second-smallest PhotoCD resolution, 256x384; to view it at a another
size, right-click the image and choose the size to view. Once the new
window is drawn, you can right-click on this new image to save it as
a JPEG, PPM, or TIFF format image.
To view an individual `.pcd' file with
xpcd, give the name
of the file as an argument.
$ xpcd driveby-001.pcd [RET]
NOTE: You can also use
display to view a `.pcd'
PhotoCD image file (see Viewing an Image in X).
See Extracting PhotoCD Images for another recipe for extracting PhotoCD images.
The following table lists other tools for viewing images.
|| Part of the ImageMagick suite; use |
|| Displays files in the special X Window Dump file format, as created
|| Views an image sent as an email attachment; requires
|| Basic image viewer for X.
|| Nice graphics viewer for X that contains tools for viewing images
in the root window.
|| View graphics as "ASCII art." This tool can view any image format
supported by the |
[<--] [Cover] [Table of Contents] [Concept Index] [Program Index] [-->]