<HTML VERSION="2.0">
<HEAD>
<TITLE>ImageMagick Image Conversion Utility</TITLE>
<LINK rev="made" href="mailto:magick@wizards.dupont.com">
<meta name="description" content="ImageMagick, version 4.2.2, is a package for
  display and interactive manipulation of images for the X Window System. It
  is written in C and interfaces to the X library, and therefore does not
  require any proprietary toolkit in order to compile.  Although the software
  is copyrighted, it is available for free and can be redistributed without
  fee.">
<meta name="keywords" content="ImageMagick, Image Magick, Image Magic,
  PerlMagick, Perl Magick, Perl Magic, CineMagick, PixelMagick, Pixel Magic,
  WebMagick, Web Magic, visualization, image processing, software development,
  simulation, image, software, AniMagick, Animagic, X11">
</HEAD>
<body background="../images/background.gif">
<A NAME="top"></A>
<CENTER>
<img src="../images/convert.gif" align=bottom width=216 height=43>
</CENTER>
<pre>
 
</pre>
<H2>
<A NAME="Contents">Contents</A>
</H2>
<UL>
<LI><A HREF="#syno">Synopsis</A>
<LI><A HREF="#desc">Description</A>
<LI><A HREF="#exam">Examples</A>
<LI><A HREF="#opti">Options</A>
<LI><A HREF="#segm">Image Segmentation</A>
<LI><A HREF="#envi">Environment</A>
<LI><A HREF="#copy">Copyright</A>
<LI><A HREF="#auth">Authors</A>
</UL>
<DL>
<H2>
<A NAME="syno">
<DT>Synopsis
</A>
</H2>
<DD> <B>convert</B> <B>[</B> <I>options</I> <B>... ]</B> <I>input_file</I>
<I>output_file</I>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="desc">
<DT>Description
</A>
</H2>
<DD> <B>Convert</B> converts an input file using one image format to  an
output file with a differing image format.  In addition, various types of image
processing can be performed on the converted image during the conversion
process. <B>Convert</B> recognizes the
following image formats:
<P>
<dl>
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>AVS</B> - AVS X image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>BIE+</B> -   Joint Bi-level Image experts Group file interchange format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>BMP+</B> -   Microsoft Windows bitmap image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>BMP24+</B> -   Microsoft Windows 24-bit bitmap image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>CGM</B> - Computer Graphics Metafile.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>CMYK</B> -  Raw cyan, magenta, yellow, and black bytes.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>DCX+</B> -   ZSoft IBM PC multi-page Paintbrush file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>DIB</B> -   Microsoft Windows bitmap image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>DICOM</B> -   Medical image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPDF</B> -  Encapsulated Portable Document Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPI</B> -  Adobe Encapsulated PostScript Interchange format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPS</B> -   Adobe Encapsulated PostScript file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPS2</B> -   Adobe Level II Encapsulated PostScript file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPSF</B> -  Adobe Encapsulated PostScript file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPSI</B> -  Adobe Encapsulated PostScript Interchange format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>EPT</B> -  Adobe Encapsulated PostScript Interchange format with TIFF preview.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>FAX+</B> -   Group 3.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>FIG</B> -   TransFig image format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>FITS</B> -  Flexible Image Transport System.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>FPX</B> -  FlashPix Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>GIF</B> -   CompuServe graphics interchange format; 8-bit color.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>GIF87</B> - CompuServe graphics interchange format; 8-bit color (version 87a).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>GRAY</B> -  Raw gray bytes.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>GRADATION </B> - gradual passing from one shade to another.  Specify the
desired shading with the filename (e.g. <tt>gradation:red-blue</tt>).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>GRANITE</B> -  granite texture.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>HDF+</B> -   Hierarchical Data Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>HISTOGRAM</B>
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>HPGL</B> -   HP-GL plotter language.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>HTML</B> -   Hypertext Markup Language a with client-side image map.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>JBIG+</B> -   Joint Bi-level Image experts Group file interchange format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>JPEG</B> -   Joint Photographic Experts Group JFIF format; compressed 24-bit color.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>ICO</B> -   Microsoft icon.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>LABEL</B> -   text image.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MAP</B> -   colormap intensities and indices.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MIFF+</B> -  Magick image file format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MNG+</B> -   Multiple-image Network Graphics.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MONO</B> -  Bi-level bitmap in least-significant-byte (LSB) first order.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MPEG+</B> -  Motion Picture Experts Group file interchange format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>MTV+</B> -
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>M2V+</B> -  Motion Picture Experts Group file interchange format (version 2).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>NETSCAPE</B> -  Netscape 216 color cube.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>NULL</B> -  NULL image.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PBM+</B> -   Portable bitmap format (black and white).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PCD</B> -   Photo CD. The maximum resolution written is 512x768 pixels.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PCDS</B> -   Photo CD. Decode with the sRGB color table.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PCL</B> -   Page Control Language.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PCX</B> -   ZSoft IBM PC Paintbrush file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PDF+</B> -   Portable Document Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PGM+</B> -   Portable graymap format (gray scale).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PICT</B> -  Apple Macintosh QuickDraw/PICT file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PIX</B> -  Alias/Wavefront RLE image format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PLASMA </B> - plasma fractal image.  Specify the base color as the
filename (e.g. <tt>plasma:gray</tt>).   Use <tt>fractal</tt> to initialize to
a random value (e.g. <tt>plasma:fractal</tt>).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PNG</B> -   Portable Network Graphics.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PNM+</B> -   Portable anymap.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PPM+</B> -   Portable pixmap format (color).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PS+</B> -    Adobe PostScript file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PSD</B> -    Adobe PhotoShop bitmap file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>PS2+</B> -   Adobe Level II PostScript file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>RAD</B> -   Radiance image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>RGB</B> -   Raw red, green, and blue bytes.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>RGBA</B> -  Raw red, green, blue, and matte bytes.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>RLA</B> -   Alias/Wavefront image file; read only.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>RLE</B> -   Utah Run length encoded image file; read only.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>SGI+</B> -   Irix RGB image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>SHTML</B> -   Hypertext Markup Language a with client-side image map.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>SUN+</B> -   SUN Rasterfile.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TEXT</B> -  raw text file; read only.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TGA+</B> -   Truevision Targa image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TIFF+</B> -  Tagged Image File Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TIFF24+</B> -  24-bit Tagged Image File Format.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TILE</B> -  tile image with a texture.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TIM</B> -  PSX TIM file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>TTF</B> -    TrueType font file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>UIL</B> -   X-Motif UIL table.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>VICAR</B> - read only.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>VID</B> -   Visual Image Directory.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>VIFF+</B> -  Khoros Visualization image file.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>WIN</B> -     select image from or display image to your computer screen.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>X</B> -     select image from or display image to your X server screen.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>XC</B> -    constant image of X server color.  Specify the image color
as the filename (e.g. <tt>xc:yellow</tt>).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>XBM</B> -   X Windows system bitmap, black and white only.
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>XPM</B> -   X Windows system pixmap file (color).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>XWD</B> -   X Windows system window dump file (color).
<dd> <IMG ALT="*" SRC="../images/ball.gif">
<B>YUV+</B> -   CCIR 601 4:1:1 file.
</dl>
<P>
<EM>Support for some of these formats require additional programs or libraries.
<A HREF="install.html">README</A> tells where to find this software</EM>.
<P>
Note, a format delineated with <tt>+</tt> means that if more than one image is
specified, it is combined into a single multi-image file.  Use
<b>+adjoin</b> if you want a single image produced for each frame.
<P>
Raw images are expected to have one byte per pixel unless <b>ImageMagick</b>
is compiled in 16-bit mode.  Here, the raw data is expected to be stored
two bytes per pixel in most-significant-byte-first order.
</DL>  
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>  
<H2>
<A NAME="exam">
<DT>Examples  
</A>
</H2>

<DD>To convert a <EM>MIFF</EM> image of a cockatoo to a SUN raster image,
use:
<p><dl>
  <dd><tt>convert cockatoo.miff sun:cockatoo.ras</tt>
</dl><p>

<DD>To convert a multi-page <EM>PostScript</EM>  document  to  individual
FAX pages, use:
<p><dl>
  <dd><tt>convert -monochrome document.ps fax:page</tt>
</dl><p>
<DD>To convert a TIFF image to a <EM>PostScript</EM>  A4  page  with  the
image in the lower left-hand corner, use:
<p><dl>
  <dd><tt>convert -page A4+0+0 image.tiff document.ps</tt>
</dl><p>
<DD>To convert a raw Gray image with a 128 byte header to a portable
graymap, use:
<p><dl>
  <dd><tt>convert -size 768x512+128 gray:raw image.pgm</tt>
</dl><p>
<DD>To convert a Photo CD image to a TIFF image, use:
<p><dl>
  <dd><tt>convert -size 1536x1024 img0009.pcd image.tiff</tt>

  <dd><tt>convert img0009.pcd[4] image.tiff</tt>
</dl><p>
<DD>To create a visual image directory of all your JPEG  images,
use:
<p><dl>
  <dd><tt>convert 'vid:*.jpg' directory.miff</tt>
</dl><p>
<DD>To annotate an image with blue  text  using  font  12x24  at
position (100,100), use:
<p><dl>
  <dd><tt>convert -font helvetica -pen blue -draw "text 100,100 Cockatoo" bird.jpg bird.miff</tt>
</dl><p>
<DD>To tile a 640x480 image with a JPEG texture with bumps use:
<p><dl>
  <dd><tt>convert -size 640x480 tile:bumps.jpg tiled.png</tt>
</dl><p>
<DD>To surround an icon with an ornamental border  to  use  with
Mosaic(1), use:
<p><dl>
  <dd><tt>convert -mattecolor #697B8F -frame 6x6 bird.jpg icon.png</tt>
</dl><p>
<DD>To create a GIF animation from a DNA molecule sequence, use:
<p><dl>
  <dd><tt>convert -delay 20 dna.* dna.gif</tt>
</dl><p>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="opti">
<DT>Options
</A>
</H2>
<DL>
<DT><B>-adjoin</B>
<DD> join images into a single multi-image file.
<p>
<DD>By default, all images of an image sequence are stored in the same
file.  However, some formats (e.g. JPEG) do not support more than one image
and are saved to separate files.  Use <b>+adjoin</b> to force this behavior.
<p>
<DT><B>-antialias</B>
<DD> remove pixel aliasing.
<P>
<DT><B>-append</B>
<DD> append a set of images.
<P>
<dd>All the input images must have the same width or height.  Images of the
same width are stacked top-to-bottom.  Images of the same height are
stacked left-to-right.  Use <b>+append</b> to stack rectangular images
left-to-right.
<P>
<DT><B>-average</B>
<DD> average a set of images.
<P>
<DT><B>-blur</B> <I>factor</I>
<DD>blurs an image.  Specify factor as the percent enhancement (0.0 -
99.9%).
<P>
<DT><B>-border</B> <I>&lt;width&gt;x&lt;height&gt;</I>
<DD>surround the image with a border of color.  See <I>X(1)</I>
for details about the geometry specification.
<P>
<DD>The color of the border is obtained from the <I>X server</I>
and is defined as <B>bordercolor</B> (class <B>borderColor</B>).
See <I>X(1)</I> for details.
<P>
<DT><B>-box</B> <I>color</I>
<DD>set the color of the annotation bounding box.  See <B>-draw</B>
for further details.
<P>
<DT><B>-charcoal</B> <EM>factor</EM>
<DD>simulate a charcoal drawing.
<P>
<DT><B>-coalesce</B>
<DD>merge a sequence of images.
<P>
<DD>See <B>X(1)</B> for details about the color specification.
<P>
<DT><B>-colorize</B> <EM>value</EM>
<DD>colorize the image with the pen color.
<P> 
<DD> Specify the amount of colorization as a percentage.  You can apply
separate colorization values to the red, green, and blue channels of the
image with a colorization value list delineated with slashes (e.g. 0/0/50).
<P>
<DT><B>-colors</B> <I>value</I>
<DD>preferred number of colors in the image.
<P>
<DD>The actual number of colors in the image may be less
than your request, but never more.  Note, this is a
color reduction option.  Images with less unique
colors than specified with this option will have any duplicate
or unused colors removed.
Refer to <A HREF="quantize.html">quantize</A> for
more details.
<P>
Note, options <B>-dither</B>, <B>-colorspace</B>, and <B>-treedepth</B>
affect the color reduction algorithm.
<P>
<DT><B>-colorspace</B> <I>value</I>
<DD>the type of colorspace: <B>GRAY</B>, <B>OHTA</B>, <B>RGB</B>,
<B>Transparent</B>, <B>XYZ</B>, <B>YCbCr</B>, <B>YIQ</B>, <B>YPbPr</B>,
<B>YUV</B>, or <B>CMYK</B>.
<P>
<DD>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 more
closely than do distances in RGB space.  These color
spaces may give better results when color reducing an
image.  Refer to <A HREF="quantize.html">quantize</A> for more details.
<P>
The <B>Transparent</B> color space behaves uniquely in that it preserves
the matte channel of the image if it exists.
<P>
The <B>-colors</B> or <B>-monochrome</B> option is required for
this option to take effect.
<P>
<DT><B>-comment</b> <i>string</i>
<DD>annotate an image with a comment.
<P>
<DD>By default, each image is commented with its file
name.  Use this option to assign a specific comment
to the image.  Optionally you can include the image
filename, type, width, height, or other image attribute by
embedding special format characters:
<p>
<dd><pre>
    %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
</pre>
<p>
For example,
<P> 
<pre>
  -comment "%m:%f %wx%h"
</pre>
<P>
<DD>produces an image comment of <B>MIFF:bird.miff 512x480</B> for an
image titled <B>bird.miff</B> and whose width is 512 and height
is 480.
<P>
<DD>If the first character of <I>string</I> is <i>@</i>, the image comment
is read from a file titled by the remaining characters in
the string.
<P>
<DT><B>-compress</B> <I>type</I>
<DD>the type of image compression: <I>None</I>, <I>BZip</I>, <I>Fax</I>,
<i>Group4</i>, <I>JPEG</I>, <I>LZW</I>, <I>RunlengthEncoded</I> or <I>Zip</I>.
<P>
<DD>Specify <B>+compress</B> to store the binary image in an
uncompressed format.  The default is the compression
type of the specified image file.
<P>
<DT><B>-contrast</B>
<DD>enhance or reduce the image contrast.
<P>
<DD>This option enhances the intensity differences
between the lighter and darker elements of the image.
Use <B>-contrast</B> to enhance the image or <B>+contrast</B> to
reduce the image contrast.
<P>
<DT><B>-crop</B> <I>&lt;width&gt;x&lt;height&gt;{+-}&lt;x offset&gt;{+-}&lt;y offset&gt;{%}</I>
<DD>preferred size and location of the cropped image.
See <I>X(1)</I> for details about the geometry
specification.
<P>
<DD>To specify a percentage width or height instead,
append <B>%</B>.  For example to crop the image by ten   
percent on all sides of the image, use <B>-crop 10%</B>.
<P>
<DD>Use cropping to apply image processing options to, or
display, a particular area of an image.
<p>
<DD>Omit the x and y offset to generate one or more subimages of a uniform size.
<p>
<DD>Use cropping to crop a particular area of an image.   Use <b>-crop
0x0</b> to trim edges that are the background color.  Add an x and y offset
to leave a portion of the trimmed edges with the image.
<P>
<DT><B>-cycle</B> <I>amount</I>
<DD> displace image colormap by amount.
<P>
<DD><i>Amount</i> defines the number of positions each colormap entry is
shifted.
<P>
<DT><B>-delay</B> <I>&lt1/100ths of a second&gt;</I>
<DD>display the next image after pausing.
<P>
This option is useful for regulating the animation of
GIF images within Netscape.. <I>1/100ths of a second</I> must
expire before the display of the next image. The
default is no delay between each showing of the image sequence.
The maximum delay is 65535.
<P>
<DT><B>-density</B> <I>&lt;width&gt;x&lt;height&gt;</I>
<DD>vertical and horizontal resolution in pixels of the image.
<P>
<DD>This option specifies an image density when decoding
a <I>PostScript</I> or Portable Document page.  The default
is 72 dots per inch in the horizontal and vertical
direction.  This option is used in concert with <b>-page</b>.
<p>
<DT><B>-depth</B> <I>value</I>
<DD> depth of the image.  This is the number of bits in a pixel.  The only
acceptable values are 8 or 16.
<P>
<DT><B>-despeckle</B>
<DD>reduce the speckles within an image.
<P>
<DT><B>-display</B> <I>host:display[.screen]</I>
<DD>specifies the X server to contact. This option is used with convert for
obtaining image or font from this X server. see <I>X(1)</I>.
<P>
<dt><b>-dispose</b> <i>method</i>
<dd>GIF disposal method.
<p>
<dd> Here are the valid methods:
<p>
<pre>
  0     No disposal specified.
  1     Do not dispose between frames.      
  2     Overwrite frame with background color from header.
  3     Overwrite with previous frame.
</pre>
<P>
<DT><B>-dither</B>
<DD>apply Floyd/Steinberg error diffusion to the image.
<P>
<DD>The basic strategy of dithering is to trade intensity
resolution for spatial resolution by averaging the
intensities of several neighboring pixels.  Images
which suffer from severe contouring when reducing
colors can be improved with this option.
<P>
<DD>The <B>-colors</B> or <B>-monochrome</B> option is required for
this option to take effect.
<P>
<DD>Use <B>+dither</B> to render Postscript without text or graphic aliasing.
<p>
<DT><B>-draw</B> <I>string</I>
<dd>annotate an image with one or more graphic primitives.
<p>
<dd>Use this option to annotate an image with one or more graphic primitives.
The primitives include
<p>
<pre>
     point
     line
     rectangle
     fillRectangle
     circle
     fillCircle
     ellipse
     fillEllipse
     polygon
     fillPolygon
     color
     matte
     text
     image
</pre>
<p> 
<dd><b>Point</b>, <b>line</b>, <b>color</b>, <b>matte</b>, <b>text</b>, and
<b>image</b> each require a single coordinate.  <b>Line</b> requires a
start and end coordinate, while <b>rectangle</b> expects an upper left
and lower right coordinate.  <b>Circle</b> has a center coordinate and a
coordinate on the outer edge.  Use <b>Ellipse</b> to draw a partial ellipse
centered at the given point, specified width and height, and start and
end of arc in degrees (e.g. 100,100 100,150 0,360). Finally, <b>polygon</b>
requires three or more coordinates defining its boundaries.  Coordinates are
integers separated by an optional comma.  For example, to define a circle
centered at 100,100 that extends to 150,150 use:
<p>
<pre>
     -draw 'circle 100,100 150,150'
</pre>
<p>
<dd>Use <b>color</b> to change the color of a pixel.  Follow the
pixel coordinate with a method:
<p>
<pre>
     point
     replace
     floodfill
     filltoborder
     reset
</pre>
<p> 
<dd>Consider the target pixel as that specified by your coordinate.  The
<b>point</b> method recolors the target pixel.  The <b>replace</b> method
recolors any pixel that matches the color of the target pixel.
<b>Floodfill</b> recolors any pixel that matches the color of the target
pixel and is a neighbor,  whereas <b>filltoborder</b> recolors any neighbor
pixel that is not the border color. Finally, <b>reset</b> recolors all pixels.
<p> 
<dd>Use <b>matte</b> to the change the pixel matte value to transparent.
Follow the pixel coordinate with a method (see the <b>color</b>
primitive for a description of methods).  The <b>point</b> method
changes the matte value of the target pixel.  The <b>replace</b> method
changes the matte value of any pixel that matches the color of the
target pixel.  <b>Floodfill</b> changes the matte value of any pixel
that matches the color of the target pixel and is a neighbor, whereas
<b>filltoborder</b> changes the matte value of any neighbor pixel that is not the
border color (<b>-bordercolor</b>).  Finally <b>reset</b> changes the matte
value of all pixels.
<p> 
<dd>Use <b>text</b> to annotate an image with text.  Follow the
text coordinates with a string.  If the string has embedded spaces,
enclose it in double quotes.  Optionally you can include the image
filename, type, width, height, or other image attribute by
embedding special format character.  See <b>-comment</b> for details.
<p>
<dd> For example,
<p>
<pre>
     -draw 'text 100,100 "%m:%f %wx%h"'
</pre>
<p>
annotates the image with <tt>MIFF:bird.miff 512x480</tt> for an image
titled <tt>bird.miff</tt> and whose width is 512 and height is 480.
To generate a Unicode character (<i>TrueType fonts only</i>), embed the
code as an escaped hex string (e.g. <tt>\\0x30a3</tt>).
<p> 
Use <b>image</b> to composite an image with another image.  Follow the
image coordinates with the filename of an image.
<p>
<dd>If the first character of <em>string</em> is <i>@</i>, the text is read
from a file titled by the remaining characters in the string.
<p> 
You can set the primitive color, font color, and font bounding box color with
<b>-pen</b>, <b>-font</b>, and <b>-box</b> respectively.  Options are
processed in command line order so be sure to use <b>-pen</b>
<em>before</em> the <b>-draw</b> option.
<P>
<DT><B>-edge</B> <I>factor</I>
<DD>detect edges within an image.  Specify <I>factor</I> as the percent
enhancement (0.0 - 99.9%). 
<P>
<DT><B>-enhance</B>
<DD>apply a digital filter to enhance a noisy image.
<P>
<DT><B>-equalize</B>
<DD>    perform histogram equalization to the image.
<P>
<DT><B>-filter</B> <I>type</I>
<dd>use this type of filter when resizing an image.
<p>
<d>Use this option to affect the resizing operation of an image (see
<b>-geometry</b>).  Choose from these filters:
<p>
<dd><pre>
     Point
     Box
     Triangle
     Hermite
     Hanning
     Hamming
     Blackman
     Gaussian
     Quadratic
     Cubic
     Catrom
     Mitchell
     Lanczos
     Bessel
     Sinc
</pre>
<p>
<dd>The default filter is <b>Mitchell</b>.
<P>
<DT><B>-flip</B>
<DD> create a "mirror image" by reflecting the scanlines in the vertical
direction.
<P>
<DT><B>-flop</B>
<DD>    create a "mirror image" by reflecting the image
scanlines in the horizontal direction.
<P>
<DT><B>-font</B> <EM>name</EM>
<DD>use this font when annotating the image with text.
<P>
<dd>If the font is a fully qualified X server font name, the font is obtained
from an X server (e.g.
<tt>-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*</tt>).  To
use a TrueType font, precede the TrueType filename with a <tt>@</tt> (e.g.
<tt>@times.ttf</tt>).  Otherwise, specify a Postscript font (e.g.
<tt>helvetica</tt>).
<P>
<DT><B>-frame</B> <I>&lt;width&gt;x&lt;height+&lt;outer bevel width&gt;+&lt;inne
r bevel width&gt;</I>
<DD>    surround the image with an ornamental border.  See
<I>X(1)</I> for details about the geometry specification.
<P>
<DD>    The color of the border is specified with the
<B>-mattecolor</B> command line option.
<P> 
<DT><B>-fuzz</B> <EM>distance</EM>
<dd>colors within this distance are considered equal.
<p>
<dd>A number of algorithms search for a target color.  By default the color
must be exact.  Use this option to match colors that are close to the
target color in RGB space.  For example, if you want to automatically trim the
edges of an image with <em>-crop 0x0</em> but the image was scanned.  The
target background color may differ by a small amount.  This option can
account for these differences.
<p>
<DT><B>-gamma</B> <I>value</I>
<DD> level of gamma correction.
<P>
<DD>The same color image displayed on two different
workstations may look different due to differences in
the display monitor.  Use gamma correction to adjust
for this color difference.  Reasonable values extend
from <B>0.8</B> to <B>2.3</B>.
<P>
<DD>You can apply separate gamma values to the red,
green, and blue channels of the image with a gamma
value list delineated with slashes (i.e. <B>1.7</B>,<B>2.3</B>,<B>1.2</B>).
<p>
<DD>Use <b>+gamma</b> to set the image gamma level without actually adjusting
the image pixels.  This option is useful if the image is of a known
gamma but not set as an image attribute (e.g. PNG images).
<P>

<DT><B>-geometry</B> <I>&lt;width&gt;x&lt;height&gt;{+-}&lt;x offset&gt;{+-}&lt;y offset&gt;{%}{!}{&lt;}{&gt;}</I>
<DD> preferred size and location of the Image window.  See
<I>X(1)</I> for details about the geometry specification.
By default, the window size is the image size and the
location is chosen by you when it is mapped.
<P>
<DD>By default, the width and height are maximum values.
That is, the image is expanded or contracted to fit
the width and height value while maintaining the
aspect ratio of the image.  <em>Append an exclamation
point to the geometry to force the image size to
exactly the size you specify</em>.  For example, if you
specify <B>640x480!</B> the image width is set to 640 pixels
and height to 480.  If only one factor is specified,
both the width and height assume the value.
<P>
<DD>To specify a percentage width or height instead,
append %.  The image size is multiplied by the width
and height percentages to obtain the final image
dimensions.  To increase the size of an image, use a
value greater than 100 (e.g. 125%).  To decrease an
image's size, use a percentage less than 100.
<P>
Use <B>&gt;</B> to change the dimensions of the image <em>only</em>
if its size exceeds the geometry specification.  <B>&lt;</B> resizes
the image <em>only</em> if its dimensions is less than the geometry
specification.  For example, if you specify <b>640x480&gt;</b> and the
image size is 512x512, the image size does not change.  However, if
the image is 1024x1024, it is resized to 640x480.
<P>
Use <B>&lt;</B> to change the dimensions of the image <em>only</em>
if its size exceeds the geometry specification.  <B>&gt;</B> resizes
the image <em>only</em> if its dimensions is less than the geometry
specification.  For example, if you specify <b>640x480&gt;</b> and the
image size is 512x512, the image size does not change.  However, if
the image is 1024x1024, it is resized to 640x480.
<P>
There are 72 pixels per inch in PostScript coordinates.
<P>
<DT><B>-gravity</B> <EM>type</EM>
<dd> direction text gravitates to when annotating the image: NorthWest, North,
NorthEast, West, Center, East, SouthWest, South, SouthEast.
See X(1) for details about the gravity specification.
<p>
<dd> The direction you choose specifies where to
position the text when annotating the image.  For example <em>Center</em>
gravity forces the text to be centered within the image.
By default, the image gravity is <em>NorthWest</em>.
<P>
<DT><B>-implode</B> <I>factor</I>
<DD> implode image pixels about the center.  Specify <em>factor</em> as the
percent implosion (0 - 99.9%) or explosion (-99.9 - 0%).
<P>
<DT><B>-interlace</B> <I>type</I>
<DD>the type of interlacing scheme: <B>None</B>, <B>Line</B>, <B>Plane</B>,
or <b>Partition</b>.  The default is <B>None</B>.
<P>
<DD>This option is used to specify the type of interlacing scheme for raw
image formats such as <B>RGB</B> or <B>YUV</B>.  <B>None</B> means do not
interlace (RGBRGBRGBRGBRGBRGB...), <B>Line</B> uses scanline interlacing
(RRR...GGG...BBB...RRR...GGG...BBB...), and <B>Plane</B> uses plane
interlacing (RRRRRR...GGGGGG...BBBBBB...).    <b>Partition</b> is like plane
except the different planes are saved to individual files (e.g.  image.R,
image.G, and image.B).
<P>
<DD>Use <B>Line</B>, or <B>Plane</B> to create an <B>interlaced GIF</B> 
or <B>progressive JPEG</b> image.
<P>
<DT><B>-label</B> <I>name</I>
<DD>assign a label to an image.
<P>
<DD>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 by
embedding special format character.  See <b>-comment</b> for details.
<p>
<dd>For example,
<P>
<pre>
    -label "%m:%f %wx%h"
</pre>
<P>
<DD>produces an image label of <B>MIFF:bird.miff 512x480</B> for an
image titled <B>bird.miff</B> and whose width is 512 and height
is 480.
<P>
<DD>If the first character of <I>string</I> is <i>@</i>, the image label is
read from a file titled by the remaining characters in the
string.
<P>
<DD>When converting to <I>PostScript</I>, use this option to specify
a header string to print above the image.   Specify the label font with
<b>-font</b>.
<P>
<DT><B>-layer</B> <I>type</I>
<DD>the type of layer: <B>Red</B>, <B>Green</B>, <B>Blue</B>,
or <b>Matte</b>.
<P>
<DD>Use this option to extract a particular <em>layer</em> from the image.
<b>Matte</b>, for example, is useful for extracting the opacity values
from an image.  
<P>
<DT><B>-linewidth</B> <EM>value</EM>
<DD>set the width of a line.  See <B>-draw</B> for further
details.
<P>
<DT><B>-loop</B> <I>iterations</I>
<DD>add Netscape loop extension to your GIF animation.
<P>
<DD>A value other than zero forces the animation to repeat itself up to
<em>iterations</em> times.
<P>
<DT><B>-map</B> <EM>filename</EM>
<DD>choose a particular set of colors from this image.
<P>
<DD>By default, color reduction chooses an optimal set of colors that
best represent the original image.  Alternatively, you can choose a
particular set of colors from an image file with this option.  Use
<b>+map</b> to reduce all images provided on the command line to a single
optimal set of colors that best represent all the images.
<P>
<DT><B>-matte</B>
<DD>store matte channel if the image has one otherwise create an opaque one.
<P>
<DT><B>-modulate</B> <I>value</I>
<DD>vary the brightness, saturation, and hue of an image.
<P>  
<DD>Specify the percent change in brightness, the color
saturation, and the hue separated by commas.
For example, to increase the color brightness by 20% and
decrease the color saturation by 10% and leave the
hue unchanged, use: <B>-modulate 20,-10</B>.
<P>
<DT><B>-monochrome</B>
<DD>transform the image to black and white.
<P>
<DT><B>-paint</B> <EM>frames</EM>
<DD> morphs an image sequence.
<p>
<dd>Both the image pixels and size are linearly interpolated to give the
appearance of a meta-morphosis from one image to the next.
<P> 
<DT><B>-negate</B>
<DD>replace every pixel with its complementary color (white becomes black,
yellow becomes blue, etc.).
<P>
<DD>The red, green, and blue intensities of an image are
negated.  Use <b>+negate</b> to only negate the grayscale pixels of the
image.
<P> 
<DT><B>-noise</B>
<DD>add or reduce noise in an image.
<P>
<DD>The principal function of noise peak elimination
filter is to smooth the objects within an image
without losing edge information and without creating
undesired structures.  The central idea of the
algorithm is to replace a pixel with its next
neighbor in value within a 3 x 3 window, if this
pixel has been found to be noise.  A pixel is defined
as noise if and only if this pixel is a maximum or
minimum within the 3 x 3 window.
<p>
<dd>Use <bb>+noise</bb> followed by a noise type to add noise to an image.
Choose from these noise types:
<pre>
    Uniform
    Gaussian
    Multiplicative
    Impulse
    Laplacian
    Poisson
</pre>
<P>
<DT><B>-normalize</B>
<DD>transform image to span the full range of color
values.
<P>
<DD><EM>This is a contrast enhancement technique</EM>.
<P>
<DT><B>-opaque</B> <EM>color</EM>
change this color to the pen color within the image.
<p>
<DD>See <b>-pen</b> for more details.
<P>
<DT><B>-page</B> <I>&lt;width&gt;x&lt;height&gt;{+-}&lt;x offset&gt;{+-}&lt;y offset&gt;{%}{!}{&lt;}{&gt;}</I>
<DD>size and location of an image canvas.
<P>
<DD>Use this option to specify the dimensions of the
<I>PostScript</I> page in dots per inch or a TEXT page in
pixels.  The choices for a Postscript page are:
<PRE>
       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
</PRE>
<DD>For convenience you can specify the page size by media
(e.g. A4, Ledger, etc.).  Otherwise, <b>-page</b> behaves much like
<b>-geometry</b> (e.g. <tt>-page letter+43+43&gt</tt>).
<p>
<dd>To position a GIF image, use <b>-page</b>
<i>{+-}&lt;x offset&gt;{+-}&lt;y offset&gt;</i>
(e.g. -page +100+200).  
<p>
<dd>For a Postscript page, the image is sized as in <b>-geometry</b> and
positioned relative to the lower left hand corner of the page by
{+-}&lt;<B>x</B> <EM>offset</EM>&gt;{+-}&lt;<B>y</B> <EM>offset</EM>&gt;.
Use <tt>-page 612x792&gt</tt>, for example, to center the image within the
page.  If the image size exceeds the Postscript page, it is reduced to fit the
page.
<p>
<dd>The default page dimensions for a TEXT image is 612x792.
<p>
<dd>This option is used in concert with <b>-density</b>.
<P>
<DT><B>-paint</B> <EM>radius</EM>
<DD>simulate an oil painting.
<p>
<dd>Each pixel is replaced by the most frequent color in a circular
neighborhood whose width is specified with <em>radius</em>.
<P>
<DT><B>-pen</B> <EM>color</EM>
<DD>set the color of the font or opaque color.  See <B>-draw</B> for further
details.
<P>
See <B>X(1)</B> for details about the color specification. A pen can also
be an image.  Specify the pen color as an image name preceded by a <tt>@</tt>
(e.g. <tt>@tile.gif</tt>).
<P>
<DT><B>-pointsize</B> <I>value</I>
<DD>pointsize of the Postscript font.
<P>
<DT><B>-preview</B> <I>type</I>
<dd>image preview type.
<p>
<d>Use this option to affect the preview operation of an image
(e.g. <tt>convert -preview Gamma Preview:gamma.gif</tt>).
Choose from these previews:
<p>
<dd><pre>
     Rotate
     Shear
     Roll
     Hue
     Saturation
     Brightness
     Gamma
     Spiff
     Dull
     Grayscale
     Quantize
     Despeckle
     ReduceNoise
     Add Noise
     Sharpen
     Blur
     Threshold
     EdgeDetect
     Spread
     Shade
     Raise
     Segment
     Solarize
     Swirl
     Implode
     Wave
     OilPaint
     CharcoalDrawing
     JPEG
</pre>
<p>
<dd>The default preview is <b>JPEG</b>.
<P>
<DT><B>-profile</b> <i>string</i>
<DD>add ICC color or IPTC newswire information profile to image.
<p>
<DD>The filename must be prefixed with the particular profile type.  For
example, <tt>icc:color.dat</tt> or <tt>iptc:news.dat</tt>.
<P>
<DD>By default, each image is commented with its file
<P>
<DT><B>-quality</B> <I>value</I>
<DD>JPEG/MIFF/PNG compression level.
<P>
<DD> For the JPEG image format, quality is 0 (worst) to 100 (best).
The default quality is 75.
<p>
<dd> Quality for the MIFF and PNG image format sets the amount of image
compression (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:
<p>
<pre>
    0: none
    1: sub
    2: up
    3: average
    4: Paeth
</pre>
<p>
<dd>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.
<p>
<dd>If filter-type is 6 or more, adaptive filtering with 
<em>minimum-sum-of-absolute-values</em> is used.
<p>
<dd>The default is quality is 75.  Which means nearly the best compression
with adaptive filtering.
<p>
<dd>For further information, see the PNG specification
(<a href=http://www.w3.org/pub/WWW/TR>RFC 2083</a>).
<P>
<DT><B>-raise</B> <I>&lt;width&gt;x&lt;height&gt;</I>
<DD>lighten or darken image edges to create a 3-D effect. See <I>X(1)</I>
for details about the geometry specification.
<P>
<DD>Use <B>-raise</B> to create a raised effect, otherwise use <B>+raise</B>.
<P>
<DT><B>-region</B> <I>&lt;width&gt;x&lt;height&gt;{+-}&lt;x
offset&gt;{+-}&lt;y offset&gt;</I>   
<DD>apply options to a portion of the image.
<p> 
<dd> By default, any command line options are applied to the entire image.  Use
<b>-region</b> to restrict operations to a particular area of the image.
<P>
<DT><B>-roll</B> {+-}&lt;x offset&gt;{+-}&lt;y offset&gt;
<DD>roll an image vertically or horizontally.  See <I>X(1)</I>
for details about the geometry specification.
<P>
<DD>A negative <I>x offset</I> rolls the image left-to-right.  A
negative <I>y offset</I> rolls the image top-to-bottom.
<P>
<DT><B>-rotate</B> <I>degrees{&lt;}{&gt;}</I>
<DD>apply Paeth image rotation to the image.
<P>   
<dd>Use <tt>&gt;</tt> to rotate the image </t>only</i> if its width exceeds the
height.  <tt>&lt;</tt> rotates the image <i>only</i> if its width is less than
the height.  For example, if you specify <tt>-90&gt;</tt> and the image size
is 480x640, the image is not rotated by the specified angle.  However,
if the image is 640x480, it is rotated by -90 degrees.
<P>
<DD>Empty triangles left over from rotating the image are
filled with the color defined as <B>bordercolor</B> (class
<B>borderColor</B>).  See <I>X(1)</I> for details.
<P>
<DT><B>-sample</B> <I>geometry</I>
<DD>scale image with pixel sampling.  See <B>-geometry</B> for
details about the geometry specification.
<P>
<DT><B>-scene</B> <I>value</I>
<DD>image scene number.
<P>
<DT><B>-seed</B> <I>value</I>
<DD>pseudo-random number generator seed value.
<P>
<DT><B>-segment</B> <I>&lt;cluster threshold&gt;x&lt;smoothing threshold&gt;</I>
<DD>segment an image by analyzing the histograms of the color components and
identifying units that are homogeneous with the fuzzy c-means technique.
<p>
<DD>Specify <i>cluster threshold</i> as the number of pixels in each cluster
must exceed the the cluster threshold to be considered valid.  <i>Smoothing
threshold</i> eliminates noise in the second derivative of the
histogram.  As the value is increased, you can expect a smoother second
derivative.  The default is 1.5.  See <A HREF="#segm">Image Segmentation</A>
for details.
<P>
<DT><B>-shade</B> <I>&lt;azimuth&gt;x&lt;elevation&gt;</I>
<DD>shade the image using a distant light source.
<P>
<DD>Specify <i>azimuth</i> and <i>elevation</i> as the position of the light
source.  Use <b>+shade</b> to return the shading results as a grayscale image.
image.
<P>
<DT><B>-sharpen</B> <I>factor</I>
<DD>sharpen an image.  Specify <I>factor</I> as the percent
enhancement (0.0 - 99.9%). 
<P>
<DT><B>-shear</B> &lt;x degrees&gt;x&lt;y degrees&gt;
<DD>shear the image along the X or Y axis by a positive
or negative shear angle.   
<P>
<DD>Shearing slides one edge of an image along the X or Y
axis, creating a parallelogram.  An X direction shear
slides an edge along the X axis, while a Y direction
shear slides an edge along the Y axis.  The amount of
the shear is controlled by a shear angle.  For X
direction shears, <I>x degrees</I> is measured relative to
the Y axis, and similarly, for Y direction shears <I>y
degrees</I> is measured relative to the X axis.
<P>
<DD>Empty triangles left over from shearing the image are
filled with the color defined as <B>bordercolor</B> (class
<B>borderColor</B>).  See <I>X(1)</I> for details.
<P>
<DT><B>-size</B> &lt;width&gt;x&lt;height>{+offset}
<DD>width and height of the image.
<P>
<DD>Use this option to specify the width and height of
raw images whose dimensions are unknown such as <B>GRAY</B>,
<B>RGB</B>, or <B>CMYK</B>.  In addition to width and height, use
<B>-size</B> to skip any header information in the image or tell
the number of colors in a <B>MAP</B> image file, (e.g. -size 640x512+256). 
<P>
<DD>For Photo CD images, choose from these sizes:
<p>
<PRE>
   192x128
   384x256
   768x512
   1536x1024
   3072x2048
</PRE>
<DD>Finally, use this option to choose a particular resolution layer of a JBIG
or JPEG image (e.g. -size 1024x768).
<P>
<DT><B>-solarize</B> <I>factor</I>
<DD> negate all pixels above the threshold level.    Specify <em>factor</em>
as the percent threshold of the intensity (0 - 99.9%).
<p>
<dd>This option produces a <em>solarization</em> effect seen when exposing
a photographic film to light during the development process.
<P>
<DT><B>-spread</B> <I>amount</I>
<DD> displace image pixels by a random amount.
<P>
<DD><i>Amount</i> defines the size of the neighborhood around each pixel to
choose a candidate pixel to swap.
<P>
<DT><B>-swirl</B> <I>degrees</I>
<DD> swirl image pixels about the center.
<P>
<DD><i>Degrees</i> defines the tightness of the swirl.
<P>
<DT><B>-transparency</B> <I>color</I>
<dd>make this color transparent within the image.
<P>
<DT><B>-texture</B> <I>filename</I>
<dd>name of texture to tile onto the image background.
<P>
<DT><B>-threshold</B> <I>value</I>
<DD> threshold the image.
<P>
<DD> Create a bi-level image such that any pixel intensity that
is equal or exceeds the threshold is reassigned the maximum intensity otherwise
the minimum intensity.
<P>
<DT><B>-treedepth</B> <I>value</I>
<DD>Normally, this integer value is zero or one.  A zero
or one tells display to choose an optimal tree depth
for the color reduction algorithm.
<P>
<DD>An optimal depth generally allows the best
representation of the source image with the fastest
computational speed and the least amount of memory.
However, the default depth is inappropriate for some
images.  To assure the best representation, try
values between 2 and 8 for this parameter.  Refer to
<A HREF="quantize.html">quantize</A> for more details.
<P>
<DD>The <B>-colors</B> or <B>-monochrome</B> option is required for
this option to take effect.
<P>
<DT><B>-units</B> <I>type</I>
<DD>the type of image resolution: <B>Undefined</B>, <B>PixelsPerInch</B>,
or <B>PixelsPerCentimeter</B>.
<P>
<DT><B>-verbose</B>
<DD>print detailed information about the image.
<P>
<DD>This information is printed: image scene number;
image name;  image size; the image class (<I>DirectClass</I>
or <I>PseudoClass</I>);  the total number of unique colors;
and the number of seconds to read and transform the
image.  Refer to <A HREF="miff.html">miff</A> for a description
of the image class.
<P>
<DD>If <B>-colors</B> is also specified, the total unique colors
in the image and color reduction error values are
printed.  Refer to <A HREF="quantize.html">quantize</A> for a
description of these values.
<P>
<DT><B>-view</B> <I>string</I>
<DD>FlashPix viewing paramters.
<P>
<DT><B>-wave</B> <I>&lt;amplitude&gt;x&lt;wavelength&gt;</I>
<DD>alter an image along a sine wave.
<P>
<DD>Specify <i>amplitude</i> and <i>wavelength</i> to effect the
characteristics of the wave.
<P>
<DT> Options are processed in command line order.  Any option you
 specify  on  the  command line remains in effect until it is
 explicitly changed by specifying the  option  again  with  a
 different effect.
<P>
<DT>By default, the image format  is  determined  by  its  magic
number.  To  specify  a particular image format, precede the
filename with  an  image  format  name  and  a  colon  (<I>i.e.</I>
<B>ps:image</B>)  or  specify the image type as the filename suffix
<P>
<DT>When you specify <B>X</B> as your image type, the filename has
special  meaning.   It  specifies  an  X window by <B>id, name</B>, or
<B>root</B>.  If no filename is specified, the window  is  selected
by clicking the mouse in the desired window.
<P>
<DT>Specify <EM>input_file</EM> as - for standard input,
<EM>output_file</EM> as -
for  standard output.  If <EM>input_file</EM> has the extension <B>.Z</B> or
<B>.gz</B>, the file is  uncompressed  with  <B>uncompress</B>  or 
<B>gunzip</B>
respectively.   If  <EM>output_file</EM> has the extension <B>.Z</B> or
<B>.gz</B>,
the file size is compressed  using  with  <B>compress</B>  or  <B>gzip</B>
respectively.   Finally,  precede the image file name with |
to pipe to or from a system command.
<P>
Use an optional index enclosed in brackets after a file name to specify
a desired subimage of a multi-resolution image format like Photo CD
(e.g. img0001.pcd[4]) or a range for MPEG images (e.g. video.mpg[50-75]).
A subimage specification can be disjoint (e.g. image.tiff[2,7,4]).
For raw images, specify a subimage with a geometry (e.g.  -size 640x512
image.rgb[320x256+50+50]).
<P>
<DT>Single images are written with  the  filename  you  specify.
However,  multi-part  images  (i.e.  a multi-page PostScript
document with <b>+adjoin</b> specified) are written with the filename followed
by a period (<B>.</B>)  and  the scene number.  You can change this behavior by
embedding a <B>printf</B> format specification in  the  file  name.
For example,
<P>
<p><dl>
  <dd><tt>image%02d.miff</tt>
</dl><p>
converts files image00.miff, image01.miff, etc.
<p>
<dt>Prepend an at sign <tt>@</tt> to a filename to read a list of image
filenames from that file.  This is convenient in the event you have too
may image filenames to fit on the command line.
</DL>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="segm">
<DT>Image Segmentation
</A>
</H2>
<dd> Use <B>-segment</B> to segment an image by analyzing the histograms
of the color components and identifying units that are homogeneous
with the fuzzy c-means technique.  The scale-space filter
analyzes the histograms of the three color components of the
image and identifies a set of classes.  The extents of each
class is used to coarsely segment the image with
thresholding.  The color associated with each class is
determined by the mean color of all pixels within the
extents of a particular class.  Finally, any unclassified
pixels are assigned to the closest class with the fuzzy c-means technique.
<P>
The fuzzy c-Means algorithm can be summarized as follows:
<P>
<UL>
<LI>Build a histogram, one for each color component of
the image.
<P>
<LI>For each histogram, successively apply the scale-
space filter and build an interval tree of zero
crossings in the second derivative at each scale.
Analyze this scale-space ``fingerprint'' to determine
which peaks or valleys in the histogram are most
predominant.
<P>
<LI>The fingerprint defines intervals on the axis of the
histogram.  Each interval contains either a minima or a
maxima in the original signal.  If each color component
lies within the maxima interval, that pixel is
considered ``classified'' and is assigned an unique
class number.
<P>
<LI>Any pixel that fails to be classified in the above
thresholding pass is classified using the fuzzy c-Means
technique.  It is assigned to one of the classes
discovered in the histogram analysis phase.
</UL>
<P>
The fuzzy c-Means technique attempts to cluster a pixel by
finding the local minima of the generalized within group sum
of squared error objective function.  A pixel is assigned to
the closest class of which the fuzzy membership has a
maximum value.
<P>
For additional information see:
<BLOCKQUOTE>
<I>Young Won Lim, Sang Uk Lee</I>, "<B>On The Color Image
Segmentation Algorithm Based on the Thresholding and
the Fuzzy c-Means Techniques</B>", Pattern Recognition,
Volume 23, Number 9, pages 935-952, 1990.
</BLOCKQUOTE>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="envi">
<DT>Environment
</A>
</H2>
<DL>
<DT><B>DISPLAY</B>
<DD>To get the default host, display number, and screen.
</DL>
</DL>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="copy">
<DT>Copyright
</A>
</H2>
<B>
<dd>Copyright 1999 E. I. du Pont de Nemours and Company
<p>
<dd>Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files ("ImageMagick"),
to deal in ImageMagick without restriction, including without limitation 
the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of ImageMagick, and to permit persons to whom the 
ImageMagick is furnished to do so, subject to the following conditions:
<p>
<dd>The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of ImageMagick. 
<p>
<dd>The software is provided "as is", without warranty of any kind, express or 
implied, including but not limited to the warranties of merchantability, 
fitness for a particular purpose and noninfringement.In no event shall 
E. I. du Pont de Nemours and Company be liable for any claim, damages or 
other liability, whether in an action of contract, tort or otherwise,
arising from, out of or in connection with ImageMagick or the use or other 
dealings in ImageMagick. 
<p>
<dd>Except as contained in this notice, the name of the E. I. du Pont de 
Nemours and Company shall not be used in advertising or otherwise to 
promote the sale, use or other dealings in ImageMagick without prior 
written authorization from the E. I. du Pont de Nemours and Company. 
</B>
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="auth">
<DT>Authors
</A>
</H2>
<DD><I>John Cristy</I>, <A HREF="mailto:magick@wizards.dupont.com">
 <I>magick@wizards.dupont.com</I></A> <B>E.I. du Pont de Nemours and Company
Incorporated</B>.
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<p><hr><p>
<a href="../ImageMagick.html"><img alt="Home Page"
  src="../images/home.gif" width=40 height=40 align=middle border=0></a>
<font size="-2">Image manipulation software that works like magic.</font>
</body>
</html>
