Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Beginning Ubuntu Linux - From Novice To Professional (2006)

.pdf
Скачиваний:
71
Добавлен:
17.08.2013
Размер:
25.54 Mб
Скачать
Tip

298

C H A P T E R 1 9 M O V I E S A N D M U L T I M E D I A

Figure 19-4. You can install Flash Player on Ubuntu to enjoy online animation, games, and interaction.

To install the Flash Player, open Synaptic Package Manager (System Administration) and search for flashplayer-mozilla. Then mark it for installation and click Apply. Once installation has finished, log out and then back in again. Configuration is automatic, and you should now be able to visit any Flash site with Firefox.

If you have problems with sound playback when watching Flash animations, try the following: open a GNOME Terminal window (Applications Accessories Terminal), and then type sudo ln -s /usr/lib/ libesd.so.0 /usr/lib/libesd.so.1. Then log out of Ubuntu and back in again.

C H A P T E R 1 9 M O V I E S A N D M U L T I M E D I A

299

Sadly, there isn’t a Linux version of the Shockwave Director browser plug-in. If you really need to be able to have access to Shockwave sites under Linux, considering using CrossOver Office (www.codeweavers.com) to install the Windows version. But be aware that CrossOver Office is commercial product, and you’ll need to pay for it.

Some sites use Java to present interaction, animation, and even movies. You can install the Java Runtime program by searching for j2re within the Synaptic Package Manager. In the list of results, click to mark for installation both the main j2re package and the mozilla-plugin package for j2re. When both are installed, log out and then back in again.

MOVIE EDITING

The field of Linux movie-editing software is still young, and only a handful of programs are available for the nonprofessional user. One of the best is Kino (www.kinodv.org), which is available in the Ubuntu software archives. Although far from being a professional-level program, Kino allows competent users to import and edit videos, apply effects, and then output in either MPEG-1 or MPEG-2 format.

If you’re looking for something more powerful, but also more complicated, then Cinelerra is well worth a look (http://heroinewarrior.com/cinelerra.php3). To quote the web site, Cinelerra is “the same kind of compositing and editing suite that the big boys use,” except it’s made for Linux! Sadly, Cinelerra isn’t in the Ubuntu repository and, at the time of writing, there wasn’t a Ubuntu-compatible package at the web site. However, a sister project that is based on Cinelerra—Cinelerra-CV—contains a Debian package that should work fine on Ubuntu. See http://cvs.cinelerra.org for details.

MainActor (www.mainconcept.com) is the Linux version of a commercial Windows project. Although it’s not free, most people agree that it’s one of the most comprehensive video editors available for Linux at the moment, and possibly the easiest to use, too.

Incidentally, professional moviemakers use Linux all the time, particularly when it comes to adding special effects to movies. Movies like Shrek 2, Stuart Little, and the Harry Potter series all benefited from the CinePaint software running under Linux! For more details, see http://cinepaint.movieeditor.com.

Watching TV

If you have a TV card, you may be able to use it to watch TV under Ubuntu. Ubuntu doesn’t come with a TV tuner application by default, but you can download the tvtime program from the software repositories using the Synaptic Package Manager.

Checking for Video Input

Ubuntu includes the Video for Linux project, an extension to the Linux kernel to allow many popular TV and video-capture cards to work. You can find out if yours is compatible by clicking System Preferences Multimedia Systems Selector. In the dialog box that appears, click the Video tab, and then click the Test button in the Default Source part of the window. If you see a video window without an error message, then your TV card is compatible. If you receive an error message, try a different input setting from the drop-down list and click Test again.

300

C H A P T E R 1 9 M O V I E S A N D M U L T I M E D I A

Installing Tvtime

To download and install tvtime, open Synaptic Package Manager (System Administration), click the Search button, and enter tvtime as a search term. In the list of results, click the entry for tvtime and mark it for installation. Then click Apply.

When the download has completed, you’ll be asked a number of questions during the configuration process. First, you need to choose your TV picture format. Users in the United States should choose NTSC. Users in the United Kingdom, Australia, and certain parts of Europe should choose PAL. To find out which TV system your country uses, look up your country at www.videouniversity.com/standard.htm. You also need to choose your geographical area from the list so that tvtime can set the correct radio frequency range for your TV card.

Once the program is installed, you’ll find it on the Applications Sound & Video menu. Figure 19-5 shows an example of tvtime in action. Using the program is straightforward, but if you need guidance, visit the program’s web site at http://tvtime.sourceforge.net.

Figure 19-5. If you have a TV tuner card, tvtime lets you watch TV on your PC!

Summary

In this chapter, we looked how you can watch movies on your PC. You’ve seen how you can update Ubuntu to work with the most popular digital video technologies, such as Windows Media Player and QuickTime.

In addition, we looked at how you can view online multimedia such as Flash animations on your computer, and discussed how you can watch TV on your PC.

In the next chapter, we take a look at image editing under Ubuntu. You’ll learn about one of the crown jewels of the Linux software scene: The GIMP.

C H A P T E R 2 0

■ ■ ■

Image Editing

The PC has become an increasingly useful tool in the field of photography. In fact, these days it’s hard to imagine a professional photographer who doesn’t use a computer in some way, either to download digital camera images or to scan in images taken using traditional filmbased cameras.

Ubuntu includes a sophisticated and professional-level image-editing program called The GIMP. The title stands for GNU Image Manipulation Program. This chapter introduces this jewel in the crown of Linux software.

Getting Pictures onto Your PC

Before you can undertake any image editing, you need to transfer your images to your PC. Depending on the source of the pictures, there are a variety of ways of doing this. We have already looked at transferring images to your PC in Chapter 8, but let’s briefly recap the procedure here.

Most modern cameras use memory cards to store the pictures. If you have such a model, when you plug the camera into your PC’s USB port, you should find that Ubuntu instantly recognizes it. An icon should appear on the desktop, and double-clicking it should display the memory card in a Nautilus window. Technically speaking, the memory card has been mounted (see Chapter 14 for an explanation of mounting).

If your camera doesn’t appear to be recognized by Ubuntu, you should consider buying a USB card reader. These devices are typically inexpensive and can read a wide variety of card types, making them a useful investment for the future. Some new PCs even come packaged with card readers. Most generic card readers should work fine under Linux, as will most new digital cameras.

If your camera isn’t recognized, however, or if it’s a few years old and uses the serial port to connect to your PC, you can try using the gThumb software (Applications Graphics gThumb Image Viewer), as explained in Chapter 8.

If you’re working with print photos, negative film, or transparencies, you can use a scanner to scan them in using the XSane image scanning program, also covered in Chapter 8. This works in a virtually identical way to the TWAIN modules supplied with Windows scanners, in that you need to set the dots per inch (DPI) figures, as well as the color depth. Generally speaking, 300 DPI and 24-bit color should lead to a true-to-life representation of most photos (although because of their smaller size, transparencies or negative film will require higher resolutions, on the order of 1,200 or 2,400 DPI).

301

302

C H A P T E R 2 0 I M A G E E D I T I N G

Introducing The GIMP

The GIMP is an extremely powerful image editor that offers the kind of functions usually associated with top-end software like Adobe Photoshop. Although it’s not aimed at beginners, those new to image editing can get the most from of it, provided they put in a little work.

The program relies on a few unusual concepts within its interface, which can catch many people off guard. The first of these is that each of the windows within the program, such as floating dialog boxes or palettes, gets its own Panel entry. In other words, The GIMP’s icon bar, image window, settings window, and so on have their own buttons on the Panel alongside your other programs, as if they were separate programs.

Note The GIMP’s way of working is referred to as a Single Document Interface, or SDI. It’s favored by a handful of programs that run under Linux and seems to be especially popular among programs that let you create things.

Because of the way that The Gimp runs, before you start up the program, it’s a wise idea to switch to a different virtual desktop (virtual desktops are discussed in Chapter 7), which you can then dedicate entirely to The GIMP.

Click Applications Graphics GIMP Image Editor to run The Gimp. When the program starts for the first time, it will run through its setup routine. Usually, you can use the default answers to the various questions asked by the wizard.

After program has setup, you’ll be greeted by what appears to be a complex assortment of program windows. Now you need to be aware of a second unusual aspect of the program: its reliance on right-clicking. Whereas right-clicking usually brings up a context menu offering a handful of options, within The GIMP, it’s the principal way of accessing the program’s functions. Right-clicking an image brings up a menu offering access to virtually everything you’ll need while editing. Ubuntu includes the latest version of The GIMP, 2.2, and this features a menu bar in the main image-editing window. This is considered sacrilege by many traditional The GIMP users, although it’s undoubtedly useful for beginners. However, the right-click menu remains the most efficient way of accessing The GIMP’s tools.

The main toolbar window, shown in Figure 20-1, is on the left. This can be considered the heart of The GIMP because, when you close it, all the other program windows are closed, too. The menu bar on the toolbar window offers most of the options you’re likely to use to start out with The GIMP. For example, File Open will open a browser dialog box in which you can select files to open in The GIMP. It’s even possible to create new artwork from scratch by choosing File New, although you should be aware that The GIMP is primarily a photo editor. To create original artwork, a better choice is a program like OpenOffice.org Draw (on the Applications Office menu).

C H A P T E R 2 0 I M A G E E D I T I N G

303

Figure 20-1. The GIMP’s main toolbar window

Beneath the menu bar in the main toolbar window are the tools for working with images. Their functions are described in Table 20-1, which lists the tools in order from left to right, starting at the top left.

Table 20-1. The GIMP Image-Editing Tools

Tool

Description of Use

Rectangular

Click and drag to select a rectangular area within the image. This selected

selection tool

area can then be copied and pasted into a different part of the image or

 

turned into a new layer.

Elliptical

Create an oval or circular selection area within the image, which you can

selection tool

then copy and paste.

Hand-drawn

Click and draw with the mouse to create a hand-drawn selection area.

selection tool

Your selection should end where it started. If not, The GIMP will draw a

 

straight line between the start and end of the selection.

Contiguous regions

Known as the “magic wand” in other image editors, this tool creates a

selection tool

selection area based on the color of the pixels where you click. For

 

example, clicking on a red car hood will select most, if not all of the

 

hood, because it is mostly red.

Color region

This tool works like the contiguous region selection tool, but will create

selection tool

a selection across the entire image based on the color you select. In

 

other words, selecting a black T-shirt will also select a black signpost

 

elsewhere in the picture if the shades are similar.

304 C H A P T E R 2 0 I M A G E E D I T I N G

Table 20-1. The GIMP Image-Editing Tools (Continued)

Tool

Description of Use

Shape selection tool

Another “magical” tool, the shape selector lets you create a selection by

 

clicking on various points within an image, with the program joining the

 

points together based on the color differences between the two points.

 

This means that you can select the outline of a car by clicking a few points

 

around the edge of the car and, provided the color of the car is different

 

from the background, The GIMP will work out the color differences and

 

select the car’s shape automatically.

Path creation tool

This tool draws Bezier curves in order to create paths. Paths are akin to

 

selections and can be saved for use later on in the image-editing process.

 

Creating a Bezier curve is not too hard to do: just click and drag to draw

 

a curve. Each extra click you make will define a new curve, which will be

 

joined to the last one. To turn the path into a selection, click the button

 

at the bottom of the toolbar.

Color picker

This lets you see the RGB, HSV, or CMYK values of any color within the

 

image. Simply click the mouse within the image.

Zoom tool

Click to zoom into the image, right-click to see various zoom options,

 

and hold down the Alt key while clicking to zoom out.

Measurer

This tool measures distances between two points (in pixels) and also

 

angles. Just click and drag to use it. The measurements will appear at the

 

bottom of the image window.

Move tool

Click and drag to move any selection areas within the image, as well as

 

rearrange the positioning of various layers.

Crop tool

Click and drag to define an area of the image to be cropped. Anything

 

outside the selection area you create will be discarded.

Rotate tool

This tool rotates any selections you make and can also rotate entire

 

layers. It opens a dialog box in which you can set the rotation manually.

 

Alternatively, you can simply click and drag the handles behind the

 

dialog box to rotate by hand.

Scale tool

Known in some other image editors as “transform,” this tool lets you resize

 

the selection area or layer. It presents a dialog box where you can enter

 

numeric values, or you can click and drag the handles to resize by hand.

Shear tool

This tool lets you transform the image by shearing it. Slant a selection by

 

clicking and dragging the corners of the selection area (if the selection

 

area isn’t square, a rectangular grid will be applied to it for the purposes

 

of transformation).

Perspective tool

This tool lets you transform a selection by clicking and dragging its four

 

corners and independently moving them without affecting the other

 

corners. In this way, a sense of perspective can be emulated.

Flip tool

This tool flips a selection or image so that it is reversed on itself, either

 

horizontally (click) or vertically (hold down Ctrl and click).

Text tool

Click on the image to add text.

Fill tool

Fill a particular area with solid color, according to the color selected in

 

the color box below.

C H A P T E R 2 0 I M A G E E D I T I N G

305

Table 20-1. The GIMP Image-Editing Tools (Continued)

Tool

Description of Use

Gradient fill

This tool will create a gradient fill based on the foreground and background

 

colors by clicking and dragging.

Pencil tool

This tool lets you draw individual pixels when zoomed in, or hard-edge

 

lines when zoomed out. Simply click and drag to draw freehand, and

 

hold down Shift to draw lines between two points.

Brush tool

This tool lets you draw on the picture in a variety of brush styles to create

 

artistic effects. A brush can also be created from an image, allowing for

 

greater versatility.

Erase tool

Rather like the Brush tool in reverse, this tool deletes whatever is under-

 

neath the cursor. If layers are being used, the contents of the layer beneath

 

will become visible.

Airbrush tool

This tool is also rather like the Brush tool, in that it draws on the picture

 

in a variety of styles. However, the density of the color depends on the

 

length of time you press the mouse button. Tap the mouse button, and

 

only a light color will appear. Press and hold the mouse button, and the

 

color will become more saturated.

Ink tool

This tool is like the Brush tool except that, rather like an ink pen, the

 

faster you draw, the thinner the brush stroke is.

Pattern stamp

Commonly known as the clone tool, this is a popular image-editing tool.

 

It is able to copy one part of an image to another via drawing with a brush-

 

like tool. The origin point is defined by holding down Ctrl and clicking.

Blur/sharpen tool

Clicking and drawing on the image will spot blur or sharpen the image,

 

depending on the settings in the tool options area in the lower half of the

 

toolbar.

Smudge tool

As its name suggests, clicking and drawing with this tool will smudge the

 

image, rather like rubbing a still-wet painting with your finger (except

 

slightly more precise).

Burn and dodge tool

This tool lets you spot lighten and darken an image by clicking and

 

drawing on the image. The results depend on the settings in the tool

 

options part of the window.

 

 

Directly beneath the image-editing tool icons, on the right, is an icon that shows the foreground and background colors that will be used when drawing with tools such as the Brush. To define a new color, double-click either the foreground (top) or background (bottom) color box. To the left is the pattern selector, which lets you choose which patterns are used with tools such as the Brush.

Beneath these icons, you’ll see the various options for the selected tool. By using the buttons at the bottom of the window, you can save the current tool options, load tool options, and delete a previously saved set of tool options. Clicking the button on the bottom right lets you revert to the default settings for the tool currently being used (useful if you tweak too many settings!).

Next to the toolbar window is the Layers dialog box. This can be closed for the moment, although you can make it visible again later, if you wish.

306

C H A P T E R 2 0 I M A G E E D I T I N G

Editing Images with The GIMP

After you’ve started The GIMP (and assigned it a virtual desktop), you can load an image by selecting File Open. The browser dialog box offers a preview facility on the right of the window.

You will probably need to resize the image window so that it fits within the remainder of the screen. You can then use the Zoom tool (see Table 20-1) to ensure that the image fills the editing window, which will make working with it much easier.

You can save any changes you make to an image by right-clicking it and selecting File Save As. You can also print the image from the same menu.

Before you begin editing with The GIMP, you need to be aware of some essential concepts that are vital to understand in order to get the most from the program:

Copy, cut, and paste buffers: Unlike Windows programs, The GIMP lets you cut or copy many selections from the image and store them for use later. It refers to these saved selections as buffers, and each must be given a name for future reference. A new buffer is created by selecting an area using any of the selection tools, then right-clicking within the selection area and selecting Edit Buffer Copy Named (or Cut Named). Pasting a buffer back is a matter of right-clicking the image and selecting Edit Buffer Paste Named.

Paths: The GIMP paths are not necessarily the same as selection areas, although it’s nearly always possible to convert a selection into a path and vice versa (right-click within the selection or path and look for the relevant option on the Edit menu). In general, the tools used to create a path allow the creation of complex shapes rather than simple geometric shapes, as with the selection tools. You can also be more intricate in your selections, as shown in the example in Figure 20-2. You can save paths for later use. To view the Paths dialog box, right-click the image and select Dialogs Paths.

Tip Getting rid of a selection or path you’ve drawn is easy. In the case of a path, simply click on any other tool. This will cause the path to disappear. To get rid of a selection, select any selection tool and quickly click once on the image, being careful not to drag the mouse while doing so.

C H A P T E R 2 0 I M A G E E D I T I N G

307

Figure 20-2. Paths allow for more elaborate and intricate selections, such as those that involve curves.

Layers: In The GIMP (along with most other image-editing programs), layers are like transparent sheets of plastic that are placed on top of the image. Anything can be drawn on each individual transparent sheet, and many layers can be overlaid in order to create a complicated image. Layers also let you cut and paste parts of the image between them. It’s also possible to apply effects and transformations to a single layer, rather than to the entire image. The Layers dialog box, shown in Figure 20-3, appears by default, but if you closed it earlier, you can open it again by right-clicking the image and selecting Dialogs Layers. The layers can be reordered by clicking and dragging them in the dialog box. In addition, the blending mode of each layer can be altered. This refers to how it interacts with the layer below it. For example, its opacity can be changed so that it appears semitransparent, thereby showing the contents of the layer beneath.