next up previous
Next: animate
Up: ImageMagick
Previous: display

import

import reads an image from any visible window on your X Windows desktop and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen. Full details of its functions can be found at http://www.wizards.dupont.com/cristy/www/import.html.

For instance, to capture the entire X Windows desktop screen in the JPEG image format in a file titled root.jpg, use:

% import -window root root.jpg

While to select a a specific window, using the mouse, and save it in Encapsulated Postscript format use:

% import figure.eps

A common problem with import running on pseudo colour displays is that the image it captures sometimes has the wrong colour map. To correct this use the -descend option, e.g.

% import -descend image.miff

By default, import quickly grabs the image from the X server. However, it may not always have the correct colors in some areas. This can happen when a sub-window has a different colour map than its parent. With -descend, import descends the window hierarchy. Descending involves grabbing the image and colour map of each window or sub-window associated with the window you select and combining them on a blank canvas. This can be significantly slower than just grabbing the top-level window but ensures that the final composite image will have the correct colour map.



next up previous
Next: animate
Up: ImageMagick
Previous: display

The Graphics Cookbook
Starlink Cookbook 15
A. Allan, D. Terrett
22nd August 2000
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council