2ImageMagick Image Capturing Utility9NF,
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.




-adjoin0
join images into a single multi-image file.

F

By default, all images of an image sequence are stored in the sameKfile. However, some formats (e.g. JPEG) do not support more than one imageLand are saved to separate files. Use +adjoin to force this behavior.



-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 unique>colors than specified with this option will have any duplicateor unused colors removed.1Refer 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,GTransparent, XYZ, YCbCr, YIQ, YPbPr,YUV, or CMYK.

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 name%
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 image:filename, type, width, height, or other image attribute by$embedding special format characters:

    %b   file size    %d   directory    %e   filename extention    %f   filename    %h   height    %m   magick    %p   page number    %s   scene number    %t   top of filename    %w   width    %x   x resolution    %y   y resolution    \n   newline    \r   carriage return


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 typeH
the type of image compression: None, BZip, Fax,NGroup4, JPEG, LZW, RunlengthEncoded or Zip.

<

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

b

-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, or'display, a particular area of an image.

P

Omit the x and y offset to generate one or more subimages of a uniform size.

F

Use cropping to crop a particular area of an image. Use -cropK0x0 to trim edges that are the background color. Add an x and y offset7to leave a portion of the trimmed edges with the image.

C

-delay <1/100ths of a second>x<seconds>I>)
display the next image after pausing.

7This option is useful for regulating the display of the4sequence of images. 1/100ths of a second must0expire before the display of the next image. TheHdefault is 6/100th of a second between each frame of the image sequence./The second value is optional. It specifies theCnumber of seconds to pause before repeating your animation sequence.

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. This option is used in concert with -page.

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.

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.

Here are the valid methods:



  0     No disposal specified.  1     Do not dispose.      $  2     Restore to background color.  3     Restore to previous.




-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.

C

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

M

Use +dither to render Postscript without text or graphic aliasing.



-frame!
include window manager frame.

q

-geometry <width>x<height>{+-}<x offset>{+-}<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,1or Partition. The default is None.

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 the-image. Optionally you can include the image:filename, type, width, height, or other image attribute byEembedding special format character. See -comment for details.



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 specifyEa header string to print above the image. Specify the label font with -font.



-monochrome+
transform the image to black and white.



-negateJ
replace every pixel with its complementary color (white becomes black,yellow becomes blue, etc.).

8

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

n

-page <width>x<height>{+-}<x offset>{+-}<y offset>{%}{!}{<}{>})
size and location of an image canvas.

4

Use this option to specify the dimensions of the9PostScript page in dots per inch or a TEXT page in/pixels. The choices for a Postscript page are:
       11x17         792  1224 "       Ledger       1224   792           Legal         612  1008       Letter        612   792       LetterSmall   612   792       ArchE        2592  3456       ArchD        1728  2592       ArchC        1296  1728       ArchB         864  1296       ArchA         648   864       A0           2380  3368       A1           1684  2380       A2           1190  1684       A3            842  1190       A4            595   842       A4Small       595   842       A5            421   595       A6            297   421       A7            210   297       A8            148   210       A9            105   148       A10            74   105       B0           2836  4008       B1           2004  2836       B2           1418  2004       B3           1002  1418       B4            709  1002       B5            501   709       C0           2600  3677       C1           1837  2600       C2           1298  1837       C3            918  1298       C4            649   918       C5            459   649       C6            323   459       Flsa          612   936        Flse          612   936       HalfLetter    396   612
:
For convenience you can specify the page size by mediaC(e.g. A4, Ledger, etc.). Otherwise, -page behaves much like7-geometry (e.g. -page letter+43+43>).

-

To position a GIF image, use -page/{+-}<x offset>{+-}<y offset>(e.g. -page +100+200).

H

For a Postscript page, the image is sized as in -geometry and@positioned relative to the lower left hand corner of the page byI{+-}<x offset>{+-}<y offset>.JUse -page 612x792>, for example, to center the image within theNpage. If the image size exceeds the Postscript page, it is reduced to fit thepage.

<

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

8

This option is used in concert with -density.

"

-pointsize value%
pointsize of the Postscript font.

-quality value$
JPEG/MIFF/PNG compression level.

C

For the JPEG image format, quality is 0 (worst) to 100 (best).The default quality is 75.

T

Quality for the MIFF and PNG image format sets the amount of image compression C(quality / 10) and filter-type (quality % 10). Compression quality?values range from 0 (worst) to 100 (best). If filter-type is 4=or less, the specified filter-type is used for all scanlines:



    0: none
    1: sub	    2: up    3: average    4: Paeth


@

If filter-type is 5, adaptive filtering is used when quality;is greater than 50 and the image does not have a color map,otherwise no filtering is used.

9

If filter-type is 6 or more, adaptive filtering with 0minimum-sum-of-absolute-values is used.

J

The default is quality is 75. Which means nearly the best compressionwith adaptive filtering.

6

For further information, see the PNG specification4(RFC 2083).

-

-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
number of screen snapshots.

K

Use this option to grab more than one image from the X server screen tocreate an animation sequence.



-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.



-screen

0

operate silently, i.e. don't ring any bells.

%

-transparency color1
make this color transparent within the image.

"

-treedepth value8
Normally, this integer value is zero or one. A zero4or one tells display to choose an 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.

Lfile specifies the image filename. If file is omitted, itDdefaults to magick.miff. The default image format is MIFF.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 1999 E. I. du Pont de Nemours and Company

K

Permission is hereby granted, free of charge, to any person obtaining aIcopy of this software and associated documentation files ("ImageMagick"),Ito deal in ImageMagick without restriction, including without limitation Ithe rights to use, copy, modify, merge, publish, distribute, sublicense, Eand/or sell copies of ImageMagick, and to permit persons to whom the GImageMagick is furnished to do so, subject to the following conditions:

O

The above copyright notice and this permission notice shall be included in 3all copies or substantial portions of ImageMagick. 

O

The software is provided "as is", without warranty of any kind, express or Iimplied, including but not limited to the warranties of merchantability, Gfitness for a particular purpose and noninfringement.In no event shall IE. I. du Pont de Nemours and Company be liable for any claim, damages or Eother liability, whether in an action of contract, tort or otherwise,Karising from, out of or in connection with ImageMagick or the use or other dealings in ImageMagick. 

I

Except as contained in this notice, the name of the E. I. du Pont de ENemours and Company shall not be used in advertising or otherwise to Epromote the sale, use or other dealings in ImageMagick without prior Ewritten authorization from the E. I. du Pont de Nemours and Company. 


*Back to Contents






Authors

C
John Cristy, Kmagick@wizards.dupont.com E.I. du Pont de Nemours and CompanyIncorporated.


*Back to Contents


2Home PageIImage manipulation software that works like magic.