2ImageMagick Image Capturing Utility4NF,
A

 


Contents





Synopsis

D
import [ options ... ] file


*Back to Contents






Description


CImport reads an image from any visible window on an X server:and outputs it as an image file. You can capture a single<window, the entire screen, or any rectangular portion of the screen. Use )displayfor redisplay,;printing, editing, formatting, archiving, image processing,etc. of the captured image.

9The target window can be specified by id, name, or may be9selected by clicking the mouse in the desired window. If7you press a button and then drag, a rectangle will form<which expands and contracts as the mouse moves. To save the5portion of the screen defined by the rectangle, just:release the button. The keyboard bell is rung once at the<beginning of the screen capture and twice when it completes.



*Back to Contents






Examples 

@
To select an X window with the mouse and save it in the MIFF/image format to a file titled window.miff, use:

!
import window.miff



9

To select an X window and save it in the Encapsulated6Postscript format to include in another document, use:

import figure.eps



;

To capture the entire X server screen in the JPEG image'format in a file titled root.jpeg, use:

,
import -window root root.jpeg







*Back to Contents






Options



E

Import options can appear on the command line or in your X=resources file. See X(1). Options on the command line 4supersede values specified in your X resources file.




-border.
include image borders in the output image.

@

The color of the border is obtained from the X server@and is defined as bordercolor (class borderColor).See X(1) for details.



-colors value,
preferred number of colors in the image.

8

The actual number of colors in the image may be less3than your request, but never more. Note, this is a0color reduction option. Images with less unique2colors than specified with this option will remain=unchanged. Refer to quantize for more details.

GNote, options -dither, -colorspace, and -treedepth%affect the color reduction algorithm.

#

-colorspace valueA
the type of colorspace: GRAY, OHTA, RGB,JTransparent, XYZ, YCbCr, YIQ, YPbPr, or YUV.

7

Color reduction, by default, takes place in the RGB.color space. Empirical evidence suggests that,distances in color spaces such as YUV or YIQ/correspond to perceptual color differences more4closely than do distances in RGB space. These color5spaces may give better results when color reducing anGimage. Refer to quantize for more details.

HThe Transparent color space behaves uniquely in that it preserves,the matte channel of the image if it exists.

?The -colors or -monochrome option is required forthis option to take effect.

!

-comment "%m:%f %wx%h"%
annotate an image with a comment.

5

By default, each image is commented with its file3name. Use this option to assign a specific comment3to the image. Optionally you can include the image1filename, type, width, height, or scene number by9embedding special format characters. Embed %f forJfilename, %m for magick, %w for width, %h for height,B%s for scene number, %b for file size in kilobytes,'or \n for newline. For example,

!

-comment "%m:%f %wx%h"

E

produces an image comment of MIFF:bird.miff 512x480 for an?image titled bird.miff and whose width is 512 and heightis 480.

J

If the first character of string is @, the image comment9is read from a file titled by the remaining characters in the string.

-compress typeI
the type of image compression: Zip or RunlengthEncoded.

<

Specify +compress to store the binary image in an4uncompressed format. The default is the compression!type of the specified image file.

?

-crop <width>{%}x<height>{%}{+-}<x%offset>{+-}<y offset> 5
preferred size and location of the cropped image..See X(1) for details about the geometryspecification.

4

To specify a percentage width or height instead,9append %. For example to crop the image by ten 8percent on all sides of the image, use -crop 10%.

9

Use cropping to apply image processing options to, orMdisplay, a particular area of an image. Use -crop 0x0 to remove edgesthat are the background color.

-delay seconds)
pause before selecting target window.

5This option is useful when you need time to ready the.target window before it is captured to a file.

7

-density <width>x<height>>
vertical and horizontal resolution in pixels of the image.

8

This option specifies an image density when decoding;a PostScript or Portable Document page. The default4is 72 pixels per inch in the horizontal and vertical direction.

7

-density <width>x<height>>
vertical and horizontal resolution in pixels of the image.

8

This option specifies an image density when decoding;a PostScript or Portable Document page. The default4is 72 pixels per inch in the horizontal and vertical direction.



-descend0
obtain image by descending window hierarchy.

8

This option reads each subwindow and its colormap of4the chosen window. The final image is guaranteed to2have the correct colors but obtaining the image issignificantly slower.

0

-display host:display[.screen]K
specifies the X server to contact. This option is used with convert for<obtaining image or font from this X server. see X(1).

!

-dispose method
GIF disposal method.

L

Graphics Interchange Format (GIF) Specification 89a of July 31, 1990 fordetails.



-dither7
apply Floyd/Steinberg error diffusion to the image.

9

The basic strategy of dithering is to trade intensity2resolution for spatial resolution by averaging the2intensities of several neighboring pixels. Images1which suffer from severe contouring when reducing(colors can be improved with this option.

-

The -colors option is required forthis option to take effect.



-frame!
include window manager frame.

C

-geometry <width>{%}x<height>{%}{+-}<x0offset>{+-}<yoffset>{!}{<}{>}%
the with and height of the image.

8

By default, the width and height are maximum values.3That is, the image is expanded or contracted to fit0the width and height value while maintaining the1aspect ratio of the image. Append an exclamation0point to the geometry to force the image size to2exactly the size you specify. For example, if you<specify 640x480! the image width is set to 640 pixels4and height to 480. If only one factor is specified,+both the width and height assume the value.

4

To specify a percentage width or height instead,4append %. The image size is multiplied by the width0and height percentages to obtain the final image4dimensions. To increase the size of an image, use a3value greater than 100 (e.g. 125%). To decrease an-image's size, use a percentage less than 100.

CUse > to change the dimensions of the image onlyDif its size exceeds the geometry specification. < resizesCthe image only if its dimensions is less than the geometryFspecification. For example, if you specify 640x480> and theCimage size is 512x512, the image size does not change. However, if1the image is 1024x1024, it is resized to 640x480.

!

-interlace typeK
the type of interlacing scheme: None, Line, Plane,2or Partition. The default is Plane.

I

This option is used to specify the type of interlacing scheme for rawIimage formats such as RGB or YUV. None means do notHinterlace (RGBRGBRGBRGBRGBRGB...), Line uses scanline interlacingC(RRR...GGG...BBB...RRR...GGG...BBB...), and Plane uses planeLinterlacing (RRRRRR...GGGGGG...BBBBBB...). Partition is like planeIexcept the different planes are saved to individual files (e.g. image.R,image.G, and image.B).

H

Use Line, or Plane to create an interlaced GIF !or progressive JPEG image.



-label name
assign a label to an image.

9

Use this option to assign a specific label to the5image. Optionally you can include the image file-5name, type, width, height, or scene number in the5label by embedding special format characters. EmbedP%f for filename, %m for magick, %w for width, %h forJheight, %s for scene number, %b for file size in kilobytes,'or \n for newline. For example,



-label "%m:%f %wx%h"

C

produces an image label of MIFF:bird.miff 512x480 for an?image titled bird.miff and whose width is 512 and heightis 480.

K

If the first character of string is @, the image label is:read from a file titled by the remaining characters in thestring.

D

When converting to PostScript, use this option to specify)a header string to print above the image.



-monochrome+
transform the image to black and white.



-negate#
apply color inversion to image.

8

The red, green, and blue intensities of an image areHnegated. Use +negate to only negate the grayscale pixels of theimage.



-pageD<width>x<height>{+-}<x offset>{+-}<y offset>4
size and location of the PostScript page.

4

Use this option to specify the dimensions of the;PostScript page in pixels per inch or a TEXT page in7pixels. The default for a PostScript page is to4center the image on a letter page 612 by 792 pixels.2The margins are 1/2" (i.e. 612x792+42+42). Othercommon sizes are:
   Letter      612x 792   Tabloid     792x1224   Ledger     1224x 792   Legal       612x1008   Statement   396x 612   Executive   540x 720   A3          842x1190   A4          595x 842   A5          420x 595   B4          729x1032   B5          516x 729   Folio       612x 936   Quarto      610x 780   10x14       720x1008
:
For convenience you can specify the page size by media(e.g. A4, Ledger, etc.).

5

The page geometry is relative to the vertical andFhorizontal density of the PostScript page. See -density for details.

JTo position a GIF image, use -page +LEFT+TOP (e.g. -page +100+200).

C

The default page dimensions for a TEXT image is 612x792.

-quality value
JPEG quality setting.

H

Quality is 0 (worst) to 100 (best). The default is 75.CThe image size increases with high quality value and vice versa. 

-

-rotate degrees{<}{>},
apply Paeth image rotation to the image.

O

Use > to rotate the image only if its width exceeds theNheight. < rotates the image only if its width is less thanLthe height. For example, if you specify -90> and the image sizeFis 480x640, the image is not rotated by the specified angle. However,6if the image is 640x480, it is rotated by -90 degrees.

9

Empty triangles left over from rotating the image are:filled with the color defined as bordercolor (class2borderColor). See X(1) for details.



-scene value
image scene number.



-screen

;

This option indicates that the GetImage request used to3obtain the image should be done on the root window,6rather than directly on the specified window. In this0way, you can obtain pieces of other windows that7overlap the specified window, and more importantly, you6can capture menus or other popups that are independent-windows but appear over the specified window.

%

-transparency color1
make this color transparent within the image.

"

-treedepth value8
Normally, this integer value is zero or one. A zero3or one tells display to choose a optimal tree depth"for the color reduction algorithm.

.

An optimal depth generally allows the best3representation of the source image with the fastest3computational speed and the least amount of memory.4However, the default depth is inappropriate for some/images. To assure the best representation, try4values between 2 and 8 for this parameter. Refer to6quantize for more details.

C

The -colors or -monochrome option is required forthis option to take effect.



-verbose/
print detailed information about the image.

4

This information is printed: image scene number;<image name; image size; the image class (DirectClass;or PseudoClass); the total number of unique colors;3and the number of seconds to read and transform the?image. Refer to miff for a descriptionof the image class.



-window id

'

select window with this id or name.

9

With this option you can specify the target window by<id or name rather than using the mouse. Specify root/to select X's root window as the target window.


<Options are processed in command line order. Any option you9specify on the command line remains in effect until it is8explicitly changed by specifying the option again with adifferent effect.

8Change - to + in any option above to reverse its effect.JFor example +frame means do include window manager frame.

Lfile specifies the image filename. If file is omitted, itHdefaults to magick.ps. The default image format is Postscript.HTo specify a particular image format, precede the filename with an imageAformat name and a colon (i.e. gif:image) or specify theBimage type as the filename suffix (i.e. image.jpg). SeeLImage Formats Supported by ImageMagick fora list of valid image formats.

ISpecify file as - for standard output. If file has theKextension .Z or .gz, the file size is compressed using withKcompress or gzip respectively. Precede the image file nameC| to pipe to a system command. If file already exists, you8will be prompted as to whether it should be overwritten.



*Back to Contents






Environment



DISPLAY8
To get the default host, display number, and screen.



*Back to Contents






Copyright

7
Copyright 1997 E. I. du Pont de Nemours and Company:Permission to use, copy, modify, distribute, and sell this8software and its documentation for any purpose is hereby6granted without fee, provided that the above copyright8notice appear in all copies and that both that copyright6notice and this permission notice appear in supporting4documentation, and that the name of E. I. du Pont de1Nemours and Company not be used in advertising or4publicity pertaining to distribution of the software:without specific, written prior permission. E. I. du Pont9de Nemours and Company makes no representations about the4suitability of this software for any purpose. It is5provided "as is" without express or implied warranty.

6

E. I. du Pont de Nemours and Company disclaims all6warranties with regard to this software, including all8implied warranties of merchantability and fitness, in no:event shall E. I. du Pont de Nemours and Company be liable9for any special, indirect or consequential damages or any6damages whatsoever resulting from loss of use, data or8profits, whether in an action of contract, negligence or6other tortious action, arising out of or in connection-with the use or performance of this software.


*Back to Contents






Authors

>
John Cristy, Fcristy@sympatico.org E.I. du Pont de Nemours and CompanyIncorporated.


*Back to Contents


4[home page]IImage manipulation software that works like magic.