Capturing screen shots and program interaction on UNIX and Linux systems
Part 3, Advanced graphical screen and window capture
This content is part # of # in the series: Capturing screen shots and program interaction on UNIX and Linux systems
This content is part of the series:Capturing screen shots and program interaction on UNIX and Linux systems
Stay tuned for additional content in this series.
As discussed in Part 1 and Part 2 of this series, capturing screen shots and a record of program interaction to illustrate application behavior is a common task for technical writers, technical marketing personnel, and for anyone who is filing a bug report on an application. Part 1 of this series focused on capturing program interaction, while Part 2 focused on image capture using command-line applications. This article, the last in the series, focuses on graphical applications for screen capture on UNIX® and Linux® systems.
UNIX and Linux graphical screen capture overview
All modern Linux and UNIX systems provide some sort of graphical
desktop, which usually includes at least one graphical screen
capture application—most often one that is specific to a
particular desktop environment. For example, GNOME provides
gnome-screenshot, and KDE provides KSnapshot. Both can
capture individual dialogs, individual windows, and the entire
screen. In addition to these somewhat simple, built-in screen and
window capture utilities, several more advanced applications that
support screen capture (such as GNU Image Manipulation Program (GIMP) and Shutter) are available
for Linux and most UNIX systems.
Desktop-specific screen capture utilities
The GNOME and KDE desktop environments that are available for most Linux and UNIX systems both include screen shot utilities that leverage the capabilities of those environments. These utilities are fast, have relatively small memory requirements, and are easy to use. However, they do not provide all the screen capture options and capabilities of the more general-purpose applications discussed later in this article (see General screen capture utilities).
gnome-screenshot application is
easy to execute and has minimal system requirements, making it
an excellent choice for simple screen captures from the GNOME
desktop. However, it can only capture images in Portable Network
Graphics (PNG) format and does not provide the fine-grained
control over object selection that is provided by applications
such as GIMP and Shutter, as discussed later in this article.
gnome-screenshot application is
available on all GNOME-based Linux and UNIX computer systems. You
can invoke it by doing one of the following:
- Select the Applications > Accessories > Take Screenshot menu command.
- Press the Print Screen key (sometimes abbreviated as PrtSc).
- Press the Alt-Print Screen key combination.
- Use the command line.
gnome-screenshot application works
slightly differently in each of these cases because they execute
the command with different options.
Take Screenshot menu command
Selecting the Take Screenshot menu command starts the
gnome-screenshot application in
interactive mode (by using the
--interactive command-line option). This
displays the dialog shown in Figure 1.
Figure 1. The
gnome-screenshot configuration dialog
Print Screen key
Pressing the Print Screen key
application with no options, captures the entire screen, and
displays the dialog shown in Figure 2.
In this dialog, you can specify the name and location of the file in
which you want to save the captured image.
Figure 2. The
gnome-screenshot save screen shot dialog
Alt-Print Screen key combination
Pressing the Alt-Print Screen key
combination (in other words, holding down the Alt key
and pressing the Print Screen key) invokes the
gnome-screenshot application with its
-w option, captures the current window, and also
displays the dialog shown in Figure 2.
application from the command line enables you to specify any of
its options. See the online reference information for the
application—available by executing the
man gnome-screenshot command—for
information about all available options.
KSnapshot is much
more powerful and flexible than its GNOME equivalent,
gnome-screenshot, but works only on KDE
desktop systems or GNOME systems where the KDE desktop and associated libraries are also installed. It is an excellent
choice for most of your screen capture needs from the KDE desktop;
however, it still does not provide the fine-grained control over object
selection provided by applications such as GIMP and Shutter,
as discussed in the next section.
KSnapshot is available on all KDE-based Linux and UNIX computer systems. You can invoke it by doing one of the following:
- Select the K Menu > Applications > Graphics > Take Screenshot menu command.
- Press the Alt-F2 key combination and enter its name into the Run Command dialog.
- Use the command line.
Starting KSnapshot in any of these ways initially displays the dialog, as shown in Figure 3.
Figure 3. The KSnapshot configuration and control dialog
After selecting the type of graphical object that you want to capture (from the Capture mode drop-down), an optional delay, and whether to include window decorations, click New Snapshot to capture the specified object or selected region. The new screen capture displays in the same dialog. You can then open it with an image editing application or save it to a file by clicking Save As and specifying the location and name of that file. In the Filter entry, you can specify the graphics file format you want to use when saving the new image—options include Encapsulated PostScript (EPS), Joint Photographic Experts Group (JPEG), PNG, X BitMap (XBM), X PixMap (XPM), and the Microsoft® Windows® BMP and Icon formats.
General screen capture utilities
The previous sections discussed the screen and image capture utilities that are provided by default with the GNOME and KDE desktops. Both of these provide advanced capabilities, such as being able to select manually a portion of the screen to capture and only capturing an image after some delay has elapsed, enabling you to select menus, show specific items in dialogs, and so on. Though these built-in applications are great, other Linux and UNIX applications provide advanced capabilities that are out of scope for basic, built-in applications.
The two applications discussed in the remainder of this article provide an impressive number of bells and whistles to keep even the most image-oriented writer happy. The first, GIMP, wasn't even designed as a screen/image capture application—it is an image editing application that includes screen capture capabilities. The second, Shutter, is a Perl script that provides a great user interface for specifying, selecting, and managing screen captures.
GIMP is a popular raster image editing application that is available for almost all modern graphical computing platforms and provides many of the same capabilities as Adobe Photoshop. GIMP's integrated screen capture capabilities and sophisticated image editing capabilities make it a natural choice for screen captures and subsequent cleanup. Though I find Shutter to be an excellent and convenient screen capture application for GNOME systems, it's difficult to beat the combination of ubiquity and power that GIMP provides.
GIMP is available for all Linux distributions and is also available for most other operating systems, including Hewlett-Packard HP-UX, IBM® AIX®, Mac OS® X, Microsoft Windows, and Sun and Oracle Solaris. (GIMP for AIX is available on the AIX Toolbox for Linux Applications CDs.) GIMP provides sophisticated integrated image capture capabilities that make captured images available for editing immediately after they are captured.
The relationship between GIMP and the GNOME desktop is a common source of confusion. GIMP is not a GNOME application and, therefore, does not require that the GNOME desktop or all of the libraries that are used by GNOME be installed on your system. Instead, GNOME requires an underlying graphical user interface (GUI) toolkit called the GIMP Toolkit (GTK) that, as the name suggests, was originally developed as a central, reusable set of components and functions for GIMP. GIMP therefore only requires a modern version of GTK (GTK+, GTK2, and so on) and some X Window System libraries (or their equivalents on non-UNIX and non-Linux systems) to run on any platform.
To capture a screen image using GIMP, select the File > Create > Screenshot menu command, which displays the dialog shown in Figure 4.
Figure 4. The GIMP configuration and control dialog
This dialog enables you to specify whether you want to capture an image of the entire screen, a specific window or dialog, or a selectable region. It also provides controls that enable you to specify whether you want to capture window decorations when capturing a window and to specify a delay in seconds before the image will be captured.
After capturing an image, GIMP automatically opens that image for editing, as shown in Figure 5. When you are done making modifications to the captured image in GIMP, you can save the image to a file using the traditional File > Save As menu command.
Figure 5. A captured image in GIMP
Shutter is a Perl script that requires the GNOME libraries and,
thus, is typically run on systems that are running the GNOME
desktop. Shutter was originally known as
gscrot because it provided a GNOME wrapper for a
command-line image capture application called
scrot. However, Shutter is now completely standalone and
no longer requires
provides a great user interface for specifying, selecting, and
managing screen captures.
You can start Shutter from the command line or by selecting the Applications > Accessories > Shutter command from the GNOME menus. When you first start Shutter, you may want to initially configure it through its Edit > Preferences dialog, shown in Figure 6.
Figure 6. Configuring Shutter
The various tabs in this dialog enable you to specify the naming scheme for the images that you capture (including a base name and image numbering), whether to include window decorations in captured window images, the format and location captured images should automatically be saved, and more.
After you finish configuring Shutter (or if you just want to use it out of the box), you can capture an image in one of the following ways:
- Select the screen (or virtual screen) that you want to capture from the Full Screen drop-down menu to capture a full-screen image.
- Select the name of the window that you want to capture from the Window drop-down menu to capture a specific window or dialog.
- Select the icon to the right of the Window drop-down to capture a section of a window.
- Select the icon to the right of the previous icon to capture a single menu or a set of cascading menus.
The captured image displays in Shutter, as shown in Figure 7.
Figure 7. Captured image in Shutter
Shutter automatically saves the images it captures based on the naming scheme identified in its Preferences dialog. You can also specify a numbering scheme—this is convenient if you are capturing a series of images that must appear in that order. It also displays all of your screen captures in separate panes within its main dialog, which is also convenient if you want to verify that you have captured all of the images that you need for explaining or documenting the sequence of windows, dialogs, and so on, that are associated with a specific process. For more information about Shutter, see Related topics.
The graphical screen capture utilities discussed in this article simplify screen capture for users who do not need (or want) to work from the command line.
The default graphical screen capture utilities provided on GNOME and KDE systems are convenient for simple screen captures, but GIMP and Shutter provide some significant advantages when you know that you need to touch up those images or when capturing multiple images.
GIMP is great as a standard screen capture tool because it is available for every modern desktop computer system. I tend to use GIMP everywhere except for GNOME systems, where I use Shutter because of its prefixing, numbering, and sophisticated selection capabilities.
gnome-screenshotpackage is part of the GNOME Utilities package and is installed by default on all systems that are running the GNOME desktop.
- KSnapshot is installed by default on all systems that are running the KDE desktop.
- Browse the technology bookstore for books on this and other technical topics.
- GIMP is a raster image editing application that also provides dialog, window, and screen capture capabilities.
- Shutter is a powerful and easy-to-use dialog, window, and screen capture application with many custom and powerful capabilities.