<HTML VERSION="2.0">
<HEAD>
<TITLE>ImageMagick Image Transforming 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/mogrify.gif" align=bottom width=222 height=57>
</center>
<pre>
 
</pre>
<H2>
<a name="Contents">Contents</A>
</H2>
<ul>
<LI><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="#copy">Copyright</A>
<LI><A HREF="#ackn">Acknowledgement</A>
<LI><A HREF="#auth">Authors</A>
</ul>
<DL>
<H2>
<A NAME="syno">
<DT>Synopsis
</A>
</H2>
<DD><B>mogrify</B> <B>[</B> <EM>options</EM> <B>...]</B> <EM>file</EM> [ [
<EM>options</EM> ...] <EM>file</EM> ...]
</dl>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="desc">
<DT>Description
</A>
</H2>
<DD><B>mogrify</B> transforms an image or a sequence of images.  These
transforms include image scaling, image rotation, color
reduction, and others.  The transmogrified image overwrites
the original image.
</DL>
<P>
<A HREF="#top"><I>Back to Contents</I></A>
<HR>
<DL>
<H2>
<A NAME="exam">
<DT>Examples
</A>
</H2>
<DD>To convert all the TIFF files in a particular directory to
JPEG, use:
<p><dl>
  <dd><tt>mogrify -format jpeg *.tiff</tt>
<p></dl>
<DD>To scale an image of a cockatoo to exactly 640 pixels in
width and 480 pixels in height, use:
<p><dl>
  <dd><tt>mogrify -geometry 640x480! cockatoo.miff</tt>
<p></dl>
</DL>
<P> 
<A HREF="#top"><I>Back to Contents</I></A>
<HR> 
<DL>
<H2>
<A NAME="opti">
<DT>Options
</A>
</H2>
<P>
<dl>
<DT><B>-antialias</B>
<DD> remove pixel aliasing.
<p>
<DT><B>-blur</B> <EM>factor</EM>
<DD>blurs an image.  Specify <EM>factor</EM> as the percent
enhancement (0.0 - 99.9%).
<P>
<DT><B>-border</B> &lt;<EM>width</EM>&gt;<B>x</B>&lt;<EM>height</EM>&gt;
<DD>surround the image with a border of color.  See <B>X(1)</B>
for details about the geometry specification.
<P>
<DD>The color of the border is obtained from the X server
and is defined as <B>bordercolor</B> (class <B>borderColor</B>).  See
<B>X(1)</B> 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>
<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> <EM>value</EM>
<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 <B>quantize(9)</B> for more details.
<P>
<DD>If more than one image is specified on the command
line, a single colormap is created and saved with each
image.
<P>
<DD>Note, options <B>-colormap</B>, <B>-dither</B>, <B>-colorspace</B>, and
<B>-treedepth</B> affect the color reduction algorithm.
<P>
<DT><B>-colorspace</B> <EM>value</EM>
<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="../www/quantize.html"><B>quantize</B></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>
<DD>The <B>-colors</B> or <B>-monochrome</B> option is required for this
option to take effect.
<P>
<DT><B>-comment</B> <EM>string</EM>
<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,
<PRE>
    -comment "%m:%f %wx%h"
</PRE>
<DD>produces an image comment of <B>MIFF:bird.miff</B> <B>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 <EM>string</EM> is <i>@</i>, the image
comment is read from a file titled by the remaining
characters in the string.
<P>
<DT><B>-compress</B> <EM>type</EM>
<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
<B>X(1)</B> 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</B> <B>10%</B>.
<P>
<DD>Use cropping to apply image processing options, or
transmogrify, only 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>&lt;1/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> &lt;<EM>width</EM>&gt;<B>x</B>&lt;<EM>height</EM>&gt;
<DD>vertical and horizontal resolution in pixels of the image.
<P>
<DD>This option specifies an image density when decoding a
Postscript or Portable Document page.  The default is
72 pixels 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> <EM>host</EM>:<EM>display</EM>[.<EM>screen</EM>]
specifies the X server to contact; see <B>X(1)</B>.
<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:
<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 scene number by
embedding special format characters.  Embed <tt>%f</tt> for filename,
<tt>%d</tt> for directory, <tt>%e</tt> for filename extention, <tt>%t</tt> for
top of filename, <tt>%m</tt> for magick, <tt>%w</tt> for width, <tt>%h</tt> for 
height, <tt>%s</tt> for scene number, or <tt>\n</tt> for newline.  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>
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.
<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>
<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>
<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>-emboss</B>
<DD>emboss the image.
<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 image
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>-format</B> <EM>type</EM>
<DD>the image format type.
<P>
<DD>This option will convert any image to the image format
you specify.  See <B>convert(1)</B> for a list of image format
types supported by <B>ImageMagick</B>.
<P>
<DD>By default the file is written to its original name.
However, if the filename extension matches a supported
format, the extension is replaced with the image format
type specified with -format.  For example, if you specify <EM>tiff</EM> as
the format type and the input image filename is <em>image.gif</EM>,
the output image filename becomes <EM>image.tiff</EM>.
<P>
<DT><B>-font</B> <EM>name</EM>
<DD>use this font when annotating the image with text.
<P>
<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> &lt;<EM>width</EM>&gt;<B>x</B>&lt;<EM>height</EM>&gt;+&lt;<EM>outer</EM> <EM>bevel</EM> <EM>width</EM>&gt;+&lt;<EM>inner</EM> <EM>bevel</EM> <EM>width</EM>&gt;
<DD>surround the image with an ornamental border.  See
<B>X(1)</B> 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> <EM>value</EM>
<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 0.8 to 2.3.
<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. 1.7/2.3/1.2).
<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 width and height of the image.  See <B>X(1)</B> for
details about the geometry specification.
<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.  Append an exclamation point to the
geometry to force the image size to exactly the size
you specify.  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
<B>%</B>.  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>
<DD>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>
<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>amount</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> <EM>type</EM>
<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>
<DD><B>-label</B> <EM>name</EM> 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,
<PRE>
    -label "%m:%f %wx%h"
</PRE>
<DD>produces an image label of <B>MIFF:bird.miff</B> <B>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 <EM>string</EM> is <i>@</i>, the image label
is read from a file titled by the remaining characters
in the string.
<P>
<DD>When converting to Postscript, 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>
<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 in an image sequence 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> <EM>value</EM>
<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</B> <B>20,-10</B>.
<P>
<DT><B>-monochrome</B>
<DD>transform the image to black and white.
<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.
This is a contrast enhancement technique.
<P>
<DT><B>-opaque</B> <EM>color</EM>
change this color to the pen color within the image.  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>
<DD>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>-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;<B>x</B> <EM>offset</EM>&gt;{+-}&lt;<B>y</B> <EM>offset</EM>&gt;
<DD>roll an image vertically or horizontally.  See <B>X(1)</B> for
details about the geometry specification.
<P>
<DD>A negative <B>x</B> <EM>offset</EM> rolls the image left-to-right.  A
negative <B>y</B> <EM>offset</EM> 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> <EM>value</EM>
<DD>image scene number.
<P>
<DT><B>-seed</B> <EM>value</EM>
<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.
<P>
<DT><B>-sharpen</B> <EM>weight</EM>
<DD>sharpen an image.  Specify <EM>factor</EM> as the percent
enhancement (0.0 - 99.9%).
<P>
<DT><B>-shear</B> &lt;<B>x</B> <EM>degrees</EM>&gt;<B>x</B>&lt;<B>y</B> <EM>degrees</EM>&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, <B>x</B> <EM>degrees</EM>&gt; is measured relative to
the Y axis, and similarly, for Y direction shears <B>y</B>
<EM>degrees</EM> 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 <B>X(1)</B> 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:
<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> <EM>value</EM>
<DD>Normally, this integer value is zero or one.  A zero or
one tells <B>mogrify</B> 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="../www/quantize.html"><B>quantize</B></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.
</H2>
<P>
<DD>This information is printed: image scene number;  image
name;  image size; the image class (<EM>DirectClass</EM> or
<EM>PseudoClass)</EM>; the total number of unique colors (if
known);  and the number of seconds to read and
transform the image.  Refer to <B>miff(5)</B> for a
description of the image class.
If <B>-colors</B> is also specified, the total unique colors
in the image and color reduction error values are
printed.  Refer to <B>quantize(9)</B> for a description of
these values.
<P>
<DT><B>-view</B> <I>string</I>
<DD>FlashPix viewing paramters.
<P>
<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>
</dl>
<dd>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.  For example, to mogrify two images, the
first with 32 colors and the second with only 16 colors,
use:
<PRE>
    mogrify -colors 32 cockatoo.miff -colors 16 macaw.miff
</PRE>
<P>
<dd>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.e.
ps:image) or specify the image type as the filename suffix
(i.e. image.ps).  See 
<A HREF="../www/convert.html"><B>convert(1)</B></A>
for a list of valid image formats.
<P>
<dd>Specify <EM>file</EM> as - for standard input and output.  If <EM>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 and subsequently
compressed using with <B>compress</B> or <B>gzip</B>.  Finally, precede
the image file name with | to pipe to or from a system
command.
<P>
<DD>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>
<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.
<p>
<A HREF="#top"><I>Back to Contents</I></A>
</dl>
<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>
<DD>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="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="ackn">
<DT>Acknowledgements
</A>
</H2>
<DD>The <B>MIT X Consortium</B> for making network transparent
graphics a reality.
<P>
<DD><I>Michael Halle</I>, <B>Spatial Imaging Group at MIT</B>, for the
initial implementation of Alan Paeth's image rotation
algorithm.
<P>
<DD><I>David Pensak</I>, <B>E. I. du Pont de Nemours and Company</B>, for
providing a computing environment that made this program
possible.
<P>
<I>Paul Raveling</I>, <B>USC Information Sciences Institute</B>. The
spacial subdivision color reduction algorithm is based on
his Img software.
</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>
