Create and Edit Images


In Linux, you can do almost every graphics task, from logo creation, complex image editing, and Web site graphics, to simple things such as just playing around with a paint program, taking the red eye out of a photo, and resizing an image. Most of your image work in Linux can be done in a program called the GIMP. However, the playing around and simple things can also be done in more basic programs, such as KPaint, for anyone who prefers to keep things simple.

GIMP

Program Info

Fedora/GNOME menu

Graphics > GIMP Image Editor

Mandrake/KDE menu

Multimedia > Graphics > The GIMP

Terminal command

gimp

Program URL

http://www.gimp.org


The GIMP is the signature graphics program for Linux. It is a powerful program that can take care of most image functions you might have used Adobe Photoshop for on a PC or Mac. Dedicated Photoshop users should not come into the GIMP expecting to find the same program or features. The GIMP is its own program, with its own way of doing things. GIMP is a screen graphics program that deals better in pixels than inches. Print designers looking for CMYK support and Pantone colors might find frustration. New versions of the GIMP include CMYK support, but print graphics are not the GIMP's strong suit. The GIMP is best used for Web graphics, digital photos, and projects that will be mainly viewed onscreen or that do not need high print quality.

You probably already have the GIMP installed; it comes with most distributions. New versions come out infrequently but incorporate big changes. If you happen to be using an older distro that came with one of the 1.x versions of the GIMP, close it now and grab a new version, 2.x or later. The usability difference between those version numbers is a vast improvement.

The first time you open the GIMP, you see a settings wizard. You can accept the default choices and move through the end of the wizard with no problem. Designers or those of a meticulous nature might want to stop along the way to adjust screen resolution and ruler settings.

The Photoshop-to-GIMP Conversion Guide

Table 9.1. Photoshop-to-GIMP Equivalents

IF YOU DO THIS IN PHOTOSHOP

… USE THIS IN THE GIMP

Resize an image

From an image window, go to Image > Scale Image. You don't need to check a box to constrain proportions. Use the symbol to the right of the width and height of your image; it toggles on and off when clicked.

Crop an image

Select the area of the image you want to keep. From an image window, go to Image > Crop. You can also use the Crop tool in the toolbox window so you can adjust the cropped area and have more options and control.

Add text to an image

Use the Text tool in the toolbox window; it's the icon with the T on it. Text is edited in a window, not displayed on the image itself.

Sharpen an image

Choose Filters > Enhance > Sharpen from the image window menu. In the pop-up window, you can adjust the amount of sharpening.

Adjust brightness, contrast, hue, or saturation

Go to Layers > Colors in the image window menu. There are choices for both BrightnessContrast and HueSaturation.

Add a new layer

Click the New Layer button in the layers window, the icon with the plus sign on it near the bottom of the window.

Duplicate a layer

Click the Duplicate Layer button in the layers window, the icon that looks like two pieces of paper at the bottom of the window.

Desaturate a layer's color

Go to Layers > Colors > Desaturate in the image window menu.

Save for Web

Simply choose File > Save from the image window menu and save the file as a .gif, .jpg, or .png. You then get the opportunity to optimize the image for the smallest file size with the best quality. Remember to check the box for Preview (in image window, will modify image's undo history) so you can see what it will look like.


Using the GIMP

The GIMP is arranged as a group of windows, not one big window, as you see in most applications. The window list on your panel shows all GIMP windows listed almost as if they were different programs. Every image you open appears in its own window. Some might enjoy this feature and find it somehow useful. I have to admit that all those windows are not my favorite GIMP behavior. When I open a whole set of images, I have to just ignore my panel window list. The two default GIMP windows are the toolbox window and the layers window.

Vector Victor

The GIMP is most useful for Web or screen-only graphics and is not the best editor for print work. The GIMP is not a vector-drawing program. Some users might regularly use a program such as Adobe Illustrator for logos or vector image editing. A few Linux programs can stand in for the programs you might be used to. Sodipodi (see http://www.sodipodi.com/) is a vector program that features alpha transparencies and vector fonts. You can also check out the programs Sketch (http://sketch.sourceforge.net/) and Karbon14 (http://www.koffice.org/karbon/).


The toolbox window has icon buttons for all the tools you can use to perform actions on an image, and it is also the GIMP's main program window. Close this window, and you close the program. Hover your mouse over each toolbox button to see the name of each tool. At the top of the toolbox window are some menus. These are the GIMP's high-level menus, File, Xtns, and Help. More menus are available in the image windows. The Preferences option is in the File menu. You will want to go adjust preferences as you use and learn more about the GIMP. The other interesting option is Dialogs, where you can change which dialog boxes are in view within the program windows, such as brushes and tool options. In the Xtns menu are choices for managing modules, plug-ins, and scripts. These are add-ons you can use with the GIMP. I suggest that you get familiar with using the GIMP before you start looking for add-ons.

Those used to other graphics programs such as Photoshop or PaintShop Pro will find a lot of common language and function in the GIMP. You still work with images in layers and still have basic functions such as resizing, cropping, hue and saturation, and brightness and contrast. Those functions are even named similarly in the GIMP as they are in other programs. The GIMP goes its own direction in a few areas, such as filters, access to tools and menus, and a custom scripting ability called Script-Fu.

If You Miss Photoshop

I know what it is like to be a dedicated Photoshop user and hate using the GIMP. I used to get mad at the GIMP and then go yell at my Linux geek friend who recommended it to me. I have learned to like using the GIMP now. You might not be to that enlightened state yet. If you find that the GIMP is not enough or too different from Photoshop, you can run several Photoshop versions in Linux using the commercial software Crossover Office (see Topic 13, "Running Windows Applications").


The GIMP can open, save, and edit numerous file types, including .gif, .jpg, .png, .tif, and .bmp files (see Figure 9.4). You can even open and edit .psd files with layers from Photoshop. The GIMP's own file format is .xcf. This is the format you should save your work in to preserve the layers. You get a prompt when saving multilayered images in other formats that cannot save multiple layers, asking if you want to export the file and warning you that information will be lost. It is a good practice to keep a copy of your work saved as an .xcf file with all of the layer information. Having that original work saved is handy if you want to edit the image later.

Figure 9.4. The GIMP with an image open.


There are two types of menu bars in the GIMP. You know about the high-level menus in the toolbox window, File, Xtns, and Help. The other set of menus shows up in each image window. These menus run along the top of the image window and can also be accessed by right-clicking anywhere in your image.

File

This menu has the usual New, Open, and Save choices. Note that the save options in the image window save only that image. The File menu in the toolbox window does not work for anything on the individual image.

Edit

Options in this menu that are different include Paste Into, which acts like Paste unless there is a selection made at the time. Paste as New pastes the Clipboard image as a new image. Buffer is a shared clipboard for all open images in the GIMP. The Stroke choices are for outlining selections.

Select

Choices are here for selecting and transforming parts of the image.

View

Most of these options are for toggling different parts and tools of the GIMP into and out of view. The handy choices on this menu are in View > Zoom to zoom in for close work or zoom out to "step back" from your work. The Shrink Wrap option is also great for getting your window sizes under control.

Image

This is where you go to scale the image and Clipboard, change the mode, and crop images. This will be one of your most used menus. You can also use the choices under Transform to flip and turn an image.

Layer

Most of the choices in this menu are better used in the layers window. However, the Colors submenu has all the choices for HueSaturation, BrightnessContrast, and Desaturation. There is also the Transparency submenu for alpha choices.

Tools

Here you can switch to a few of the basic tools, but using the toolbox window is better.

Dialogs

These choices are sort of a subset of the Views menu, enabling you to open different dialog boxes and palettes such as brush choices.

Filters

This menu is comparable to the Filter menu in PhotoShop. Here you will find all the effects for images, as well as a few run-of-the-mill image enhancements such as Sharpen. Open an image and play with applying some of the filters, to get familiar with what they do.

Python-Fu and Script-Fu

This is the GIMP's scripting language. Script-Fu is like a more powerful version of the macros that are used in some Windows programs. A few popular scripts, such as drop shadow, are built into the default installation of the GIMP, but new scripts can be written or found online to use in the GIMP. There is also now a Python-Fu menu in the image window. Python-Fu is just like Script-Fu, but for developers who want to write their scripts using the Python language.

Saving files in the GIMP gives you opportunities to make some decisions about the final output image. Unlike other programs, you do not use a drop-down menu in the Save dialog box to choose the file type to save your image as; this is determined from how you name the file. If you call your image MichelangeloAtMountRushmore.jpg, it will be saved as a .jpg image. For image types such as .gif, .png, and .jpg, you get the opportunity to optimize the image during the save process, with the final optimized image previewed in the image window itself.

TOOL KIT 9.2

Create a Multilayer Image with the GIMP

Let's make the first picture for Michelangelo's virtual vacation photo album, a picture of Michelangelo and his Capuchin monkey, Don, at Mount Rushmore. We will need three photos to composite together: Michelangelo, Don, and the background scene. You can download example images to work with at the URL in Step 2. You can also choose to composite other pictures on your own. Either way, you will learn some important GIMP functions. Come on, it'll be fun, like crafts time in school.

1.

Open the GIMP.

2.

Open the three files you have chosen to composite. If you're following along with the bouncing ball at home, download these three images:

http://www.snerf.com/linuxdesktopgarage/examples/michelangelo.xcf

http://www.snerf.com/linuxdesktopgarage/examples/don.xcf

http://www.snerf.com/linuxdesktopgarage/examples/mountrushmore.jpg

3.

Open your background image, mountrushmore.jpg. Save it as new image by going to File > Save As. Let's save it as vacationphoto01.xcf.

4.

Open the two insert images, michelangelo.xcf and don.xcf. These are .xcf files because I have already cut out Michelangelo and Don from their background images.

5.

Go to Michelangelo's picture. Notice that there are two layers, Mike and Background. Mike is the layer with his image cut out, and Background is a layer of solid black. Highlight the Mike layer in the layers window. Now select that entire layer by going to Select > All or by clicking Ctrl+A.

6.

Copy that layer's image to the Clipboard using Edit > Copy, or click Ctrl+C.

7.

Click the background image of Mount Rushmore. Paste the Michelangelo image into the background with Edit > Paste or Ctrl+V.

8.

Don't click anything else yet. The pasted image is shown in the layers window as a temporary layer, or floating selection, called Pasted Layer (see Figure 9.5). You can choose to have the pasted layer become part of the existing layer underneath or to have the pasted layer become its own layer. I want the image on its own layer. Click the New Layer button in the layers window. That makes Pasted Layer into a permanent layer.

Figure 9.5. The Background layer with the floating temporary layer above it.


9.

Rename the new layer by right-clicking that layer in the layers window and choosing Edit Layer Attributes. Name it Michelangelo.

10.

Now go get Don. This image has two layers as well, Don and Background. Repeat the steps used with Michelangelo's picture: Select all of the Don layer and copy it. Make sure you have the Background layer of the composite picture selected before you paste in the new image. Paste it on to the background image, create a new layer for it, and then name the new layer Don. You can see all the layers in Figure 9.6.

Figure 9.6. Everything pasted in and ready to position in the composite image.


11.

What we have now is the composite image with our two heroes floating over Thomas Jefferson's face. We need to position them. In the toolbox window, choose the Move Layers & Selections tool.

12.

Highlight the Michelangelo layer in the layers window, and then click back in the image window. You can now drag the Michelangelo image anywhere you like. I'm putting him toward the bottom. Do the same with Don.

13.

With the vacationers in position, the image is finished (see Figure 9.7). Save the .xcf version, File > Save.

Figure 9.7. The finished image.


14.

Export the image to a .jpg for use in our photo album by going to File > Save As. Then name the file vacationphoto01.jpg. Just typing the .jpg extension in the name lets the GIMP know to convert the image to that file format. You are prompted to export the image; click Export. You now see a Save as JPEG window that lets you set the optimization for the image. I am going to move the Quality slider to 75. Check the Preview box at the top, and then click the image window to see what the image will look like at that quality setting. When you're ready, click OK.


All the features in the GIMP might be overwhelming to you if you just want to quickly crop or edit one of your own photos. Use as much or as little of the power in the GIMP as you like. Most of the time, I open the program to simply resize and crop an image.

KPaint

Program Info

Fedora/GNOME menu

Graphics > KPaint

Mandrake/KDE menu

Multimedia > Graphics > KPaint

Terminal command

kpaint

Program URL

http://docs.kde.org/en/HEAD/kdegraphics/kpaint/


Sometimes you need to play. Sometimes you need to doodle. Sometimes you need to give the kids something to do for a while. Sometimes you need to open a picture of a politician you don't like and draw on a funny moustache and devil horns (see Figure 9.8). You could do all of those things in the GIMP, but sometimes you want to stay simple. KPaint is the simple solution. The program is comparable to Paint in Windows. Everything in KPaint is basic. As must be obvious to you now, the K means that it is a KDE program.

Figure 9.8. Using KPaint to abuse James K. Polk.


If you have ever used Microsoft Paint, you have pretty much used KPaint. The two programs are similar in function. There are simple tools, such as a paintbrush or line tool, and a plain white palette to draw or paint on. If you are frightened by all the options in the GIMP, you can do simple resizing of images in KPaint, but you will lose the option of controlling the quality of image that you save.



Linux Desktop(c) Garage
Linux(R) Desktop Garage
ISBN: 0131494198
EAN: 2147483647
Year: 2006
Pages: 141

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net