7
W O R K I N G W I T H G R A P H I C S
This chapter addresses the standard KDE application KPaint
and the third-party application xscanimage, which is most
likely already on your KDE desktop as part of your Linux distribu-
tion bundle. If not, it can easily be acquired online. This chapter also
touches on Kontour, KSnapshot (a standard KDE application designed to
capture screenshots), and the image viewers KView and gv. Other image viewers
and graphics applications may be included on your system, depending on your
version and distribution, but if you familiarize yourself with the ones covered
here, you'll find the others work similarly.
KPaint
KPaint is an easy-to-use graphical painting program. To access it, go to the K
menu, scroll to Graphics, and choose Paint (or KPaint, depending on your ver-
sion of KDE). You'll be presented with an introductory window.
6594 LITW Chapter 7 9/12/02 3:59 PM Page 117
118
Chapter 7
The Toolbar
To get started, familiarize yourself with the toolbar, working from left to right.
Figure 7.1: KPaint Opening Window
The Page Icon
You can open a new drawing window with the page icon. You'll be prompted to
choose a numeric window size in pixels. This is a complicated subject that we'll
address further when we talk about image scanning. For now, all you need to
remember is that images viewed on a monitor (think web images) should render
at 72 pixels per inch. Thus, for an image you want to be 4 inches wide by 3
inches tall, you'll need a 288 by 216 pixel "canvas." You can resize your canvas
later by choosing Image · Resize from the pull- down Image menu above the
toolbar. Note: when you resize the canvas, any art you have already drawn will
also be resized.
T I P
KPaint is a bitmap drawing tool, meaning that you are drawing with pixels. If you scale
up your image, the program will increase the number of pixels used to represent what
was formerly a single pixel, resulting in jagged edges. You may like this effect, but you'll
most likely want to go the other direction, i.e., start a bit bigger and then resize smaller to
increase image crispness.
Figure 7.2: The KPaint Toolbar
6594 LITW Chapter 7 9/12/02 3:59 PM Page 118
Working with Graphics
119
The Folder Icon
You can open an existing graphic using the folder icon by entering the path and
filename in the Location bar. The format of the graphic you are opening must
be one that KPaint can read. The accepted file types are listed on the Filter pull-
down menu.
T I P
KPaint can open TIFF files but may not show color correctly.
Save
It's a good idea to save your file on a regular basis. Besides normal concerns of
system locks and power failures, KPaint does not have an undo or restore fea-
ture. So once you've altered a file, there's no going back. One work-around is to
save your file regularly with another filename. This harkens back to the bad old
days when you had to develop the habit of toggling back and forth between two
or more saved files to ensure that you had a good copy, in case some cool effect
you added didn't turn out as planned.
Cut, Copy, and Paste to the Clipboard
The cut, copy, and paste icons allow you to cut, copy, or paste your artwork to
and from other applications. Using the tool, drag the mouse around the area
you want to cut or copy and select Edit · Copy (or Cut). Use the paste icon to
place the selection back into the image or into another application.
Magnification
Use the percentage and magnify tools to set your view magnification manually
or to zoom in or out at set increments. Setting your view at 100% shows you how
your art will look in print or on the Web.
The Drawing Tools
KPaint includes two ellipse tools that draw ovals or perfect circles in a chosen
color. You also can draw in straight lines or use the rectangle or rounded- corner
rectangle tool by clicking the shape or line type, and then clicking and dragging
the mouse on the canvas. The default colors are red and green. Press the left
mouse button to paint in red (or the color on the left) and the right mouse but-
ton to paint in green (or the color on the right). To change default colors, see
the section "Color" later in this chapter.
You can spray colored pixels with the spray can tool or use the A-shaped
Text tool to add words to your image--but only in black. There is no color
option with the text tool.
KPaint is a simple program; you cannot choose the brush size, text size, or
font. If you need more control, use The GIMP (see Chapter 8).
6594 LITW Chapter 7 9/12/02 3:59 PM Page 119
120
Chapter 7
Copy and Paste within a Document
The little rectangular marquee allows you to select an area to copy or cut. After
you have selected the area, use the Edit pull- down menu to choose Cut, Copy,
or Paste. Place the cursor at one corner of the area you want to select and drag
to the opposite corner. If you are satisfied with the selection, go to the pull-
down menu (Edit · Copy or Edit · Cut). To paste the item back into your
image, click on Paste in the Edit menu, and then go back to your image and
position the mouse cursor at the location where you want the item placed. Left-
click to paste the item (wherever and as many times as you want). Left- clicking
will keep pasting the item until you select another tool to work with or select
another item to copy or cut. You also can paste into a new document by select-
ing Paste Image from the Edit menu.
T I P
You can configure the toolbar to your liking; try playing around with
Settings · Configure Toolbar.
Color
The Color menu is to the right of the drawing area. You'll see a thumbnail of
your artwork, and below that are buttons for two color choices (remember, you
can toggle between them while drawing by using the left and right mouse but-
tons). Below the color buttons is a pull- down menu with some color swatch
options. In the figure here, the web-friendly color swatch menu is selected. If
you click the left or right color buttons below the thumbnail, you'll enter the
Color Mixing Palette, which allows more advanced color selection. Simply click
the swatch where you see the color of your choice, and move the arrow on the
bar on the right up or down, until you see the shade you're looking for appear
solidly in the box. If you click OK, that color will become the color for the left
or right button.
Figure 7.3: Color Menu Icon
6594 LITW Chapter 7 9/12/02 3:59 PM Page 120
Working with Graphics
121
You can also add new colors to the Custom Color menu, which then appear
on the Color Swatch pull- down menu on the main KPaint window. Simply click
the Add to Custom Colors button, and you'll see your chosen color appear on
the custom color swatch.
The Color menu also allows you to enter HSV (hue/saturation/value), RGB
(red/blue/green), or HTML (RGB colors in hexadecimal format) numeric color
equivalent manually. However, color value and color space are subjects beyond
the scope of this book. Images are created for different media, such as monitor-
only presentation software, the Web, or print. Each media works best with a par-
ticular color space model. For most applications you are safe using the RGB color
space for images that will be viewed on a monitor, and the CMYK (also called
process color) color space for images destined for commercial printing.
Document Information
At the bottom of the KPaint window, you'll find some useful information about
window size, view, current tool selected, and location of the file. Keeping an eye
on this information will help you stay organized.
Play around with KPaint and become familiar with the KPaint tools and
menus. You'll find it time well spent when you move on to the much more elab-
orate, powerful, and exciting world of The GIMP in Chapter 8. As an intermedi-
ate step, play with Xpaint, which is not part of KDE but may be available on the
Graphics menu, depending on your Linux distribution. Xpaint works a lot like
KPaint, but it offers a much larger range of options for color, patterns, brush
size, and text insertion.
Figure 7.4: Document Information Menu
Figure 7.5: A Sample Drawing from KPaint
6594 LITW Chapter 7 9/12/02 3:59 PM Page 121
122
Chapter 7
Scanning
Scanners allow you to take photos, slides, printed materials, or even paper-and-
pencil drawings and import them into the computer in a format a graphical
application can read. A number of commercial and free scanning applications
are available. Here we discuss the GNU utility xscanimage.
xscanimage
Depending on your Linux distribution, xscanimage resides on the distribution
menu (K menu · SuSE · Graphic · Graphics · XScanImage) or under
Graphics and then under the distribution name (K menu · Graphics · Debian
· xscanimage).
After selecting xscanimage, you'll be presented with an introductory window.
The Preferences pull- down menu (Preferences · Advanced Options) pro-
vides further options. However, depending on your monitor size and screen res-
olution, this menu window may be too large to fit on your screen.
Figure 7.6: xscanimage Opening Window
Figure 7.7: xscanimage Advanced Options
6594 LITW Chapter 7 9/12/02 3:59 PM Page 122
Working with Graphics
123
Eventually, you may want to try out the various options to see what they do,
but in the meantime, leave everything at the default settings except Scan mode
and Scan resolution. Determine which type of scan mode is appropriate:
Lineart, Halftone (for drawings), Grayscale, or Color (for photographs).
Scan Mode Options
For pen-and- ink drawings, use the Lineart scan mode, which produces high-
contrast, black-and-white line images. You may need to adjust the Contrast set-
tings to get the result you want. In the figure here, Contrast is set to +58.
Figure 7.8: Scan Mode Options
The Halftone option creates an image composed of all- black pixels. Areas of
light or dark are created by using more or fewer black pixels. You may want to
explore this cool effect for use with low- resolution printing such as photocopies
or newsprint.
Figure 7.9: Example of Type of Artwork Appropriate for Lineart Scan Mode
6594 LITW Chapter 7 9/12/02 3:59 PM Page 123
124
Chapter 7
For photos, choose Grayscale or Color, depending on what you need in the
finished piece.
Figure 7.10: Output of a Color Photograph Scanned in Halftone Mode
Under Advanced Options, you'll find settings for Gamma correction and
Geometry. For general purposes, you can safely leave Gamma correction and
Geometry at their default settings. When you are ready to learn more about
Figure 7.11: A Color Photograph Scanned in Grayscale Mode
6594 LITW Chapter 7 9/12/02 3:59 PM Page 124
Working with Graphics
125
gamma correction or scanning resolutions, check out some online tutorials,
such as http://www.cgsd.com/papers/gamma_intro.html or
http://hem.passagen.se/harsman/gamma.htm.
Preparing to Scan
Before scanning, prepare a Save pathway for your file. Under Output Filename
check the directory pathname, which defaults to your home directory, and give
your scan a name.
End your filename with the three-character extension of the file type you
want: for example, .tif for TIFF or .jpg for JPEG format. Unlike applications on
other operating systems you may be familiar with, this program smart-saves based
on the three-character format extension. This means it will save in a format based
only on the three-character extension; you don't have to select a file type.
T I P
If you are scanning more than one photo, be careful! Check the filename pathway before
you click the Scan button. If it's the same as the previous scan's filename, you'll overwrite
that file.
While scanners come in several configurations, such as drum or slide, most
office environments use the more common flatbed scanner. Flatbed scanners
look like desktop photocopying machines and open from the top.
After cleaning the glass below the scanner lid (known as the plate), use the
guides to position the piece to be scanned on the scanner plate. Take care to
line up rectangular items such as pages of text, photos, or artwork that include
straight lines with the edge of the scanner plate. Although you may rotate
scanned images later, with applications like The GIMP or Kontour, the results
are sometimes poor. Take time to ensure the quality of the resulting image prior
to scanning.
Open the Preview window by clicking the button at the bottom right corner
of xscanimage's opening window, and then click Acquire Preview. The scanner
will conduct a prescan, and a thumbnail of your image will appear in the
Preview window. Next, use the cursor to select only the part you want to scan, or
go back to the xscanimage window and adjust your settings; keep clicking
Acquire Preview until you are satisfied.
Figure 7.12: Check the Directory Pathway before Saving New Scan Files
6594 LITW Chapter 7 9/12/02 3:59 PM Page 125
126
Chapter 7
When you are ready, click the Scan button (located to the left of the
Preview button). You will not see scanning results until you actually open the
image in a graphical application such as The GIMP.
T I P
Clean up prior to scanning! Handle photos by the edges or with gloves. If you are using
a flatbed scanner, clean the glass plate with regular glass cleaner before scanning. You'll
save valuable retouching time later.
Scanning Resolutions
The xscanimage program has a default resolution of 300 dots per inch (dpi),
and you can decrease or increase the dpi value from 12 to 1,600. The higher the
number, the larger your image will be, both in terms of system resources
required to render it and in actual dimensions on the screen. If your image will
be viewed only on a monitor as part of a presentation package (or on the Web),
and you are happy with the original size, scan at 72 or 96 dpi. In the world of
computer monitors, there are 72 or 96 dots per inch on the screen, depending
on whether your computer is Mac- or PC- compatible. Either way, you'll be fine
working with 72 dpi images. If you need a larger image, scan at 144 dpi or
more. The resulting graphic will still be 72 dpi, but it will be larger than the
original on the screen.
If your image is intended for commercial print, things get a lot more com-
plicated. Ink- on-paper printing technology uses a measure called lines per inch
(lpi). The rule of thumb for images intended for commercial printing is this:
lpi x 2 = dpi. Set your scanning resolution to acquire an image at least four times
Figure 7.13: The Acquire Preview Window Showing Low-Resolution Version of an Image,
So that Necessary Adjustments Can Be Made Prior to Scanning

6594 LITW Chapter 7 9/12/02 3:59 PM Page 126
Working with Graphics
127
bigger than you want it to be on the printed page. For images that will be
viewed only on a monitor, scan at a one-to- one aspect ratio, or larger than one-
to- one if you want a small image to appear larger on the screen.
Moire Patterns
Moire comes from the French language, meaning an irregular wavy pattern in fab-
ric. Moire patterns occur when you scan something that already includes a
halftone screen, such as a printed image. Printed jobs are usually set to print as lit-
tle dots on the page. Color is represented by dots of cyan, magenta, yellow, and
black. Because the dots are so small, your eyes will mix the colors so that you see a
continuous range of color and not just colored dots. The press operator at the
printer's will use a different screen angle for each ink to form a nice rosette pat-
tern of colored dots, which helps the eye mix the dots into perceived colors. Look
at a photo in a magazine with a magnifying glass, and you'll see what we mean.
When you scan a printed page, the screen angles won't match. The rosette
pattern will be visible in your scanned on-screen image, and if you send it to a
printer this way, you'll end up with a messy final result. There are ways to lessen
this problem using The GIMP, but in general, don't scan printed images. You'll
be safer legally as well.
Kontour
KDE comes with an Adobe Illustrator clone called Kontour (formerly known as
KIllustrator). Kontour is a vector drawing application. In other words, images
you see on the screen are calculated mathematically by the application, resulting
in perfectly smooth edges and text. This is especially important if your docu-
ment is intended for traditional printing on paper. The GIMP, as you will see in
Chapter 8, works with images as collections of individual pixels and is the right
application to use for paint effects or photographs. Kontour is also right for
working with text or geometric shapes. However, you can work with both, and
bitmapped images from The GIMP can be imported or placed into Kontour
documents.
Getting Started with Kontour
Access Kontour from K menu · Office · Kontour. You'll be presented with an
introductory screen.
T I P
If you can't find Kontour under
Office
on the K menu, type
kontour
in the Run
Command dialog box.
Here you can open an existing Kontour document, a recent document, or a
new document. You even can open files formatted for XFig (.fig), MS Office
(.msod), or Windows Metafile (.wmf) as templates.
6594 LITW Chapter 7 9/12/02 3:59 PM Page 127
128
Chapter 7
Open a new file, and you'll see a drawing window with tool options down
the left side, and file, view, copy, and paste options across the top.
Figure 7.14: Opening Kontour
The toolbar has tools for drawing freehand lines, Bezier paths (see the dis-
cussion on Bezier tools in Chapter 8, under "Smart Selection"), various geomet-
ric shapes, text, and text on a path. You also can import clipart or bitmap
Figure 7.15: A Kontour New Document Window
6594 LITW Chapter 7 9/12/02 3:59 PM Page 128
Working with Graphics
129
images into your document. Use the Layers tab to organize your work. You can
set individual layers to be hidden, to print, or to be the current working layer.
If you are familiar with Adobe Illustrator, note that Kontour includes some
of the same features but is much less sophisticated overall. Experiment with the
tools, remembering that the right button on the mouse provides access to fur-
ther options and preference settings.
Grab `n Go with KSnapshot
Perhaps you need to include a screenshot for a presentation, user documenta-
tion, or a website. KSnapshot allows you to capture screenshots of all open win-
dows on your desktop or of one specific window.
First, set up the windows you want to capture on your desktop. Next, access
KSnapshot (K menu · Graphics · Screen Capture). A pop-up window will show
a small thumbnail image and two buttons, Grab and Save. Review the directory
path and filename, and add the three- character extension of the file format you
desire, for instance, .png, .jpg, or .bmp. If you don't change the filename,
KSnapshot defaults to PNG format, names the screenshot "snapshot1.png", and
saves this screenshot to your current directory. Pressing Save will capture an
image of your entire desktop in its current state.
For more control over a screenshot, check the box for Only grab the win-
dow containing the pointer box. Next, click Grab, and the KSnapshot window
will vanish. Now, click within the borders of the window you want to acquire.
Use the Delay option to allow a few seconds' pause before the screenshot cap-
ture. You'll need this option, for example, if you want to grab a pull- down menu
in action. This feature works exactly like a timer on a camera.
Figure 7.16: The KSnapshot Window
6594 LITW Chapter 7 9/12/02 3:59 PM Page 129
130
Chapter 7
When the Grab operation is complete, the KSnapshot window will reap-
pear. A small thumbnail image of the captured screenshot will be displayed in
the viewing window. Make any necessary changes to the directory path and file-
name, and then click the Save button.
Figure 7.17: The Delay Option Allows Capture of Fluid Menus in Transition
KView
Sometimes you may need to view or alter an image, but you don't need all the
bells and whistles of an application like Kontour or The GIMP. KView is
designed for this purpose and is included with all versions of KDE. KView
allows you to place an image on your desktop's background, adjust brightness,
transform the image, or conduct a slide show of multiple images.
Getting Started with KView
Access KView, sometimes called Image Viewer, from the K menu (K menu ·
Graphics · Image Viewer).
T I P
KView can also be opened by typing
kview filename
on the command line. To open all
files in a particular directory, type
kview *
. See Chapter 13 on using the command line.
Figure 7.18: Review the Pathway before Saving
6594 LITW Chapter 7 9/12/02 3:59 PM Page 130
Working with Graphics
131
Here we have an image of Larry Ewing's famous Tux the Penguin, the
Linux mascot image created in celebration of the Linux 2.0 kernel.
Figure 7.19: Opening a File from the Command Line
T I P
KView defaults to a short window. Resize it by dragging the window's corner tab.
Playing with KView
A limited number of View, Transform, and Filter options are available from the
menubar. Here we have chosen Transform · Flip vertical.
Figure 7.20: Tux the Linux Penguin
Figure 7.21: Oh Ye Flipping Tux!
6594 LITW Chapter 7 9/12/02 3:59 PM Page 131
132
Chapter 7
If you love your image so much that you want to see it every day, you can
make it your KDE desktop background via the Desktop pull- down menu.
If you change your mind, go to the KDE Control Center's Look & Feel
options to remove the background image. See Chapter 11 for more details on
customizing your desktop.
KView provides a few simple options for adjusting image brightness and
gamma on the Filter · Intensity menu. You also can covert your image to
grayscale and blur the image via Filter · Grayscale or Filter · Smooth.
Figure 7.22: Creating a Tiled Desktop with KView
Figure 7.23: The Smooth Filter Run Several Times on the Tux Image
6594 LITW Chapter 7 9/12/02 3:59 PM Page 132
Working with Graphics
133
You can sort or otherwise reorganize all open files under the Images · List
menu (KView allows you to view only one open image at a time).
The menu option Slideshow scrolls through each open file in sequence.
Choose Settings · Configure Kview to adjust slideshow interval settings.
gv
This useful application does not come standard with KDE, but it is in such com-
mon use that it may be available on your desktop via K menu · Graphics ·
Viewers · GV or by typing
gv
from the Run Command dialog box.
gv is a PostScript file viewer. It is used to open, view, and print .ps (PostScript)
or .eps (Encapsulated PostScript) files. Choose File · Open to open a PostScript file.
Figure 7.24: The List Menu List Options
Figure 7.25: The gv Open Menu Window
6594 LITW Chapter 7 9/12/02 3:59 PM Page 133
134
Chapter 7
T I P
These days, a lot of EPS-formatted files include a TIFF-format preview. This allows users
to view a thumbnail of the image before opening the actual file. The gv program will not
open EPS images that include a TIFF preview. Instead, an error message dialog box will
appear in the gv window. If you encounter an error message dialog box when opening an
EPS image, request a version of the file with the Preview selection set to None.

6594 LITW Chapter 7 9/12/02 3:59 PM Page 134