With the rise of digital photography, there has been an equal decline in the need for image scanners. However, there are still times that you want to use a scanner; thankfully, Fedora makes it easy. You can also use many types of image scanners with The GIMP. In the past, the most capable scanners required a SCSI port. Today, however, most scanners work through a USB port. You must have scanner support enabled for Linux (usually through a loaded kernel module, scanner.o) before using a scanner with The GIMP. Although some scanners can work via the command line, you will enjoy more productive scanning sessions using a graphical interface because image manipulation tasks, such as previewing and cropping, can save time before actually scanning an image. Most scanners in use with Linux use the Scanner Access Now Easy (SANE) package that supports and enables graphical scanning sessions. SANE consists of two software components. A low-level driver enables the hardware support and is specific to each scanner. Next, a graphical scanner interface X client known as xsane is used as a plug-in or ancillary program (or script) that adds features to The GIMP. Note Although xsane is commonly used as a GIMP plug-in, it can also be used as a standalone program. Another useful program is Joerg Schulenburg's gocr client, used for optical character recognition (OCR). Although not a standalone application, it is included in the Kooka scanning application. This program works best with 300 dots per inch (dpi) scans in several different graphics formats. OCR is a resource-intensive task and can require hundreds of megabytes of disk storage! A list of currently supported scanners can be found at http://www.sane-project.org/sane-supported-devices.html. Unfortunately, if your scanner doesn't appear on the list, you should not expect it to work with the SANE software. There is also a list on that same page for drivers not yet included, but you must be able to compile the application from source to use them. Supported USB scanners are automatically detected and the appropriate driver is loaded automatically. The USB devices tell the USB system several pieces of information when they are connectedthe most important of which are the vendor ID and the device ID. This identification is used to look up the device in a table and load the appropriate driver. Many scanners are supported in Linux. If yours is not, it still might be possible to use it. The Kooka and xsane scanner applications are included with Fedora and are fairly straightforward to use. They can both be found in the Graphics menu as the Scanning and Scan & OCR Program menu items.
Working with Graphics FormatsImage file formats are developed to serve a specific technical purpose (lossless compression, for example, where the file size is reduced without sacrificing image quality) or to meet a need for a proprietary format for competitive reasons. Many file formats are covered by one or more patents. For example, the GIF format has fallen into disfavor with the open-source crowd because the patent holder has only recently decided to begin enforcing his patent rights. If you want to view or manipulate an image, you need to identify the file format to choose the right tool for working with the image. The file's extension is your first indicator of the file's format. The graphics image formats supported by the applications included with Red Hat include
An extensive list of image file extensions can be found in the man page for ImageMagick, an excellent application included with Fedora, which you learn more about in upcoming sections of this chapter. Tip Fedora includes dozens of graphics conversion programs, and there are few, if any, graphics file formats that cannot be manipulated when using Linux. These commands can be used in Perl scripts, shell scripts, or command-line pipes to support many types of complex format conversion and image manipulation tasks. See the man pages for the ppm, pbm, pnm, and pgm families of commands. Also see the man page for the convert command, which is part of a suite of extremely capable programs included with the ImageMagick suite. Often, a file you want to manipulate in some way is in a format that cannot be used by either your graphics application or the final application. The solution is to convert the image filesometimes through several formats. The convert utility from ImageMagick is useful as is the netpbm family of utilities. If it is not already installed, ImageMagick can be installed with the Add Remove Software GUI found in the System Settings menu; the netpbm tools are always installed by default. The convert utility converts between image formats recognized by ImageMagick. Color depth and size also can be manipulated during the conversion process. You can use ImageMagick to append images, surround them with borders, labels, rotate and shade them, and perform other manipulations well-suited to scripting. Commands associated with ImageMagick include display, animate, identify, and import. The application supports more than 130 different image formatsall listed in the man page for ImageMagick.
The netpbm tools are installed by default because they compose the underpinnings of graphics format manipulation. The man page for each image format lists related conversion utilities; the number of those utilities gives you some indication of the way that format is used and shows how one is built on another:
Capturing Screen ImagesYou can use graphics manipulation tools to capture images that are displayed on your computer screen. Although this technique was used for the production of this book, it has broader uses; there is truth to the cliché that a picture is worth a thousand words. Sometimes it is easier to show an example than it is to describe it. A captured screen image (also called a screen grab or a screenshot) can be used to illustrate an error in the display of an application (a font problem, for example) or an error dialog that is too complex to copy down by hand. You might just want to share an image of your beautifully crafted custom desktop configuration with your friends or illustrate your written documents. In this section, you learn how to capture screen images for these and other purposes. When using the GNOME desktop, you can take advantage of the built-in screenshot mechanism (gnome-panel-screenshot). Access this tool by pressing the Print Screen key. (Alt+Print Screen takes a screenshot of only the window that has focus on a desktop.) Captured images are saved in .png format. You also can capture screen images from a remote computer using tools supported by Fedora. The import command (one of ImageMagick's commands) was used to take the screenshots for this book; for example, using a local computer and a remote computer on a LAN. First, we ran $ xhost + on the remote computer to allow another computer access to the X server on the remote machine; the command to take the screenshot is run on our local machine like this: $ import -window root -display 192.168.2.4:0 12fig07.jpg This utility made a difficult task easy because the publisher required the screenshots be done from an 800x600 screen (too small to comfortably work in) to accommodate its printing and production equipment. We could also have used the classic UNIX tool xwd to take screenshots. The command would have looked similar to that of import: $ xwd -root -display 192.168.2.4:0 -out 12fig07.jpg Although the screenshots could have been taken with The GIMP and saved in the appropriate format, we would have had to run The GIMP on that computer and navigate the menus every time we captured an imagethe remote option of import was very convenient. We did not use Ksnapshot (not included in the menus, but available from the command line) because it does not support the .pcx format the publisher used to use and it must be run locally. However, it can take screenshots easily and is our preferred tool for use on a single machine.
|