Creating Images

Creating Images

Scanners

If you already have traditional photographs that you want to digitize, you'll need to scan them. Linux supports a wide variety of scanners, both paper-feed and flatbed, as long as the appropriate bus type is compiled into the system. Older scanners are SCSI-based and will require an SCSI adapter card, unless your motherboard has an integrated SCSI controller. Newer scanners use USB.

Once the hardware issues are worked out, all you need is the xscanimage program and the SANE plug-ins. SANE is the Linux answer to TWAIN, a common API that was developed for Windows software to communicate with a variety of scanners. Each scanner manufacturer provides an interface between the TWAIN API and its own proprietary protocols. With this simple architecture, a single image program can use almost any type of scanner without having to support it directly. Such is the case with xscanimage.

I'd show you how these programs work, but I can't do that since I don't own a scanner. But you can visit the Web sites listed at the end of this chapter to obtain information and tutorials on these applications.

Digital Cameras

Another popular way to obtain digital images that is now within the reach of the public is via a digital camera. Digital cameras use a semiconductor device called a CCD (change- coupled device), which is light-sensitive like traditional film. However, the CCD is broken up into pixels, and the amount and color of light hitting each pixel can be read out by an on-board microprocessor and converted directly into an image file. Typically this will be a JPEG file, taking advantage of the good compression provided by that format. The current generation of digital cameras have a resolution from 1 to 5 megapixels, which corresponds to an image width of 1200 “2500 pixels, and a slightly lower height.

If you have a digital camera, retrieving the images from it is a breeze . Simply download the gphoto package: a GTK-based application that currently provides the widest support for different types of digital cameras. Unfortunately, some manufacturers use proprietary communications protocols, and some (oh, horrors!) even use proprietary file formats. If you're unlucky enough to have one of these cameras, you may have to use the development snapshots of gphoto , bother the manufacturer, or even be reduced to using the manufacturer's Windows-only software just to do the download. Since I was personally running Linux before I bought a digital camera, I made sure to do my research and found a camera that met my needs for resolution, open file format, and gphoto support.

There are two ways to connect digital cameras: Almost all of them have a traditional serial port connector, and most modern cameras now have USB ports. gphoto has support for both types of connectors, but there are some limitations on the USB cameras supported. Personally, I use a plain old serial port connector, which works fine for my purposes.

The gphoto Web site has a list of supported cameras and instructions on how to use the application. In fact, it's simple enough to figure out just from looking at the menu options. The first time you start the program, it will ask which port the camera is connected to. Assuming you are using a traditional serial port, just select the appropriate /dev/ttySx device and you should be ready to go. Also, make sure that the cable is securely connected and that the camera is powered on and set to the appropriate mode to communicate with the computer. In the majority of cases it will simply work. Figure 22-2 shows the main application window after I've downloaded image thumbnails from the camera.

Figure 22-2. gPhoto main application window.

The images you obtain from a moderately priced digital camera of 2 “3 megapixels will be in the range of 2000 x 1500 pixels. This will be quite large when viewed on a relatively low resolution display like a monitor. The major operation you'll need to perform on such an image is a resize; typically, you'll want to scale each image to about a quarter of its original size. You can quickly do this with ImageMagick:

$ convert bigphoto.jpg -scale 640 webphoto.jpg

This scales a large photo down to a width of 640 pixels and preserves the aspect ratio. In the next section, I'll show you some other ways to enhance digital photos or any other kind of image.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

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