<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />

  <title>RMagick 1.15.6: class Image (instance methods, part 3)</title>
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii" />
  <meta name="GENERATOR" content="Quanta Plus" />
  <meta name="Copyright" content=
  "Copyright (C) 2006 by Timothy P. Hunter" />
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
<script type="text/javascript" src="scripts/doc.js">
</script>
<script type="text/javascript">
  //<![CDATA[
    <!-- Pre-load this image so that the browser knows how big it is. -->
    <!-- Begin
    flower_hat = new Image();
    flower_hat.src = "ex/images/Flower_Hat.jpg";
    // End -->
  //]]>
</script>
<style type="text/css">
  /*<![CDATA[*/

  /*
   * This style is used for the list of PreviewType
   * constants defined for the preview method, below.
   */
  #prevlist ul {
    float: left;
    list-style: none;
    margin-bottom: 0;
  }

  /*
   * This style is used for the list of QuantumOperator
   * constants defined for the quantum_operator method, below.
  *
  */
  #quantum_op_list {
    list-style-type: none;
  }

  /*]]>*/
</style>
</head>

<body>
  <h6 id="header">RMagick 1.15.6 User's Guide and Reference</h6>

  <div class="nav">
    &laquo;&nbsp;<a href="image2.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href=
    "draw.html">Next</a>&nbsp;&raquo;
  </div>

  <h1>class Image <span class="superclass">&lt; Object</span>
  (class and instance methods, part 3)<br />
  <span class="mixin">mixes in Comparable</span></h1>

  <div id="toc">
    <h2>Table of Contents</h2>

    <h3>instance methods</h3>

    <div>
      <div class="toccol">
        <ul>
          <li><a href="#preview">preview</a></li>

          <li><a href="#profile_bang">profile!</a></li>

          <li><a href="#properties">properties</a></li>

          <li><a href="#quantize">quantize</a></li>

          <li><a href="#quantum_operator">quantum_operator</a></li>

          <li><a href="#radial_blur">radial_blur</a></li>

          <li><a href=
          "#radial_blur_channel">radial_blur_channel</a></li>

          <li><a href="#raise">raise</a></li>

          <li><a href=
          "#random_threshold_channel">random_threshold_channel</a></li>

          <li><a href="#recolor">recolor</a></li>

          <li><a href="#reduce_noise">reduce_noise</a></li>

          <li><a href="#resample">resample</a></li>

          <li><a href="#resize">resize</a></li>

          <li><a href="#resize_bang">resize!</a></li>

          <li><a href="#resize_to_fit">resize_to_fit</a></li>

          <li><a href="#resize_to_fit_bang">resize_to_fit!</a></li>

          <li><a href="#roll">roll</a></li>

          <li><a href="#rotate">rotate</a></li>

          <li><a href="#rotate_bang">rotate!</a></li>

          <li><a href="#sample">sample</a></li>

          <li><a href="#sample_bang">sample!</a></li>

          <li><a href="#scale">scale</a></li>

          <li><a href="#scale_bang">scale!</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href="#segment">segment</a></li>

          <li><a href="#sepiatone">sepiatone</a></li>

          <li><a href=
          "#set_channel_depth">set_channel_depth</a></li>

          <li><a href="#shade">shade</a></li>

          <li><a href="#shadow">shadow</a></li>

          <li><a href="#sharpen">sharpen</a></li>

          <li><a href="#sharpen_channel">sharpen_channel</a></li>

          <li><a href="#shave">shave</a></li>

          <li><a href="#shave_bang">shave!</a></li>

          <li><a href="#shear">shear</a></li>

          <li><a href=
          "#sigmoidal_contrast_channel">sigmoidal_contrast_channel</a></li>

          <li><a href="#signature">signature</a></li>

          <li><a href="#sketch">sketch</a></li>

          <li><a href="#solarize">solarize</a></li>

          <li><a href="#splice">splice</a></li>

          <li><a href="#spread">spread</a></li>

          <li><a href="#statistics">statistics</a></li>

          <li><a href="#stegano">stegano</a></li>

          <li><a href="#stereo">stereo</a></li>

          <li><a href="#store_pixels">store_pixels</a></li>

          <li><a href="#strip_bang">strip!</a></li>

          <li><a href="#swirl">swirl</a></li>

          <li><a href=
          "#texture_fill_to_border">texture_fill_to_border</a></li>
        </ul>
      </div>

      <div class="toccol">
        <ul>
          <li><a href=
          "#texture_floodfill">texture_floodfill</a></li>

          <li><a href="#threshold">threshold</a></li>

          <li><a href="#thumbnail">thumbnail</a></li>

          <li><a href="#thumbnail_bang">thumbnail!</a></li>

          <li><a href="#to_blob">to_blob</a></li>

          <li><a href="#to_color">to_color</a></li>

          <li><a href="#transparent">transparent</a></li>

          <li><a href="#transpose">transpose</a></li>

          <li><a href="#transpose_bang">transpose!</a></li>

          <li><a href="#transverse">transverse</a></li>

          <li><a href="#transverse_bang">transverse!</a></li>

          <li><a href="#trim">trim</a></li>

          <li><a href="#trim_bang">trim!</a></li>

          <li><a href="#unique_colors">unique_colors</a></li>

          <li><a href="#unsharp_mask">unsharp_mask</a></li>

          <li><a href=
          "#unsharp_mask_channel">unsharp_mask_channel</a></li>

          <li><a href="#view">view</a></li>

          <li><a href="#vignette">vignette</a></li>

          <li><a href="#watermark">watermark</a></li>

          <li><a href="#wave">wave</a></li>

          <li><a href="#wet_floor">wet_floor</a></li>

          <li><a href="#white_threshold">white_threshold</a></li>

          <li><a href="#write">write</a></li>
        </ul>
      </div>
    </div>
  </div>

  <h2 class="methods">instance methods</h2>

  <div class="sig">
    <h3 id="preview">preview</h3>

    <p><span class="arg">image</span>.preview(<span class=
    "arg">aPreviewType</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates an image that contains 9 small versions of the
    receiver image. The center image is the unchanged receiver. The
    other 8 images are variations created by transforming the
    receiver according to the specified preview type with varying
    parameters.</p>

    <p>A preview image is an easy way to "try out" a transformation
    method.</p>

    <h4>Arguments</h4>

    <p>One of the following PreviewType constants:</p>

    <div id="prevlist">
      <ul>
        <li>RotatePreview</li>

        <li>ShearPreview</li>

        <li>RollPreview</li>

        <li>HuePreview</li>

        <li>SaturationPreview</li>

        <li>BrightnessPreview</li>

        <li>GammaPreview</li>

        <li>SpiffPreview</li>

        <li>DullPreview</li>

        <li>GrayscalePreview</li>

        <li>QuantizePreview</li>

        <li>DespecklePreview</li>

        <li>ReduceNoisePreview</li>

        <li>AddNoisePreview</li>

        <li>SharpenPreview</li>
      </ul>

      <ul>
        <li>BlurPreview</li>

        <li>ThresholdPreview</li>

        <li>EdgeDetectPreview</li>

        <li>SpreadPreview</li>

        <li>SolarizePreview</li>

        <li>ShadePreview</li>

        <li>RaisePreview</li>

        <li>SegmentPreview</li>

        <li>SwirlPreview</li>

        <li>ImplodePreview</li>

        <li>WavePreview</li>

        <li>OilPaintPreview</li>

        <li>CharcoalDrawingPreview</li>

        <li>JPEGPreview</li>
      </ul>
    </div>

    <div style="clear:both"></div>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>This half-size preview demonstrates the SolarizePreview
    argument.</p>

    <p><a href="javascript:popup('preview.rb.html')"><img src=
    "ex/preview.jpg" alt="preview example" title=
    "Click to see the example script" /></a></p>

    <h4>Magick API</h4>

    <p>PreviewImage</p>
  </div>

  <div class="sig">
    <h3 id="profile_bang">profile!</h3>

    <p><span class="arg">image</span>.profile!(<span class=
    "arg">name</span>, <span class="arg">profile</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p><span class="imquote">Adds or removes a ICM, IPTC, or
    generic profile from an image.</span> If <code>profile</code>
    is <code>nil</code>, the specified profile is removed from the
    image. Use <code>profile('*', nil)</code> to remove all
    profiles from the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>name</dt>

      <dd>The profile name, or "*" to represent all the profiles in
      the image.</dd>

      <dt>profile</dt>

      <dd>The profile value, or <code>nil</code> to cause the
      profile to be removed.</dd>
    </dl>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p><a href="image1.html#add_profile">add_profile</a> and
    <a href="image1.html#delete_profile">delete_profile</a> perform
    very similar functions. However, <code>add_profile</code>
    accepts the name of a profile file on disk instead of the
    profile data itself and, if the file contains more than one
    profile, will load all the profiles at once.</p>

    <h4>Magick API</h4>

    <p>ProfileImage</p>

    <h4>Notes</h4>

    <p>&times;Magick does not automatically remove profiles when
    resizing images. If you are trying to make your JPEG thumbnail
    images as small as possible, use <code>profile!</code> to
    remove any profiles from the image as well. Also see <a href=
    "#strip_bang">strip!</a></p>
  </div>

  <div class="sig">
    <h3 id="properties">properties</h3>

    <p><span class="arg">image</span>.properties <span class=
    "arg">[ {|name,value| block} ]</span> -&gt; <em>aHash</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>If called with an associated block, <code>properties</code>
    runs the block once for each property defined for the image.
    The block arguments are the property name and its value. If
    there is no block, <code>properties</code> returns a hash with
    one element for each property. The hash key is the property
    name and the associated value is the property value.</p>

    <h4>Returns</h4>

    <p>If called without a block, returns a hash, otherwise returns
    <code>self</code>.</p>

    <h4>See also</h4>

    <p><a href="image1.html#aref">[&nbsp;]</a>, <a href=
    "image1.html#aset">[&nbsp;]=</a></p>

    <h4>Note</h4>

    <p>The EXIF property is not created until the first time an
    EXIF tag or entry number is referenced.</p>
  </div>

  <div class="sig">
    <h3 id="quantize">quantize</h3>

    <p><span class="arg">image</span>.quantize(<span class=
    "arg">number_colors</span>=256, <span class=
    "arg">colorspace</span>=Magick::RGBColorspace, <span class=
    "arg">dither</span>=<code>true</code>, <span class=
    "arg">tree_depth</span>=0, <span class=
    "arg">measure_error</span>=<code>false</code>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Analyzes the colors within a reference image
    and chooses a fixed number of colors to represent the image.
    The goal of the algorithm is to minimize the difference between
    the input and output image while minimizing the processing
    time.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>number_colors</dt>

      <dd>The maximum number of colors in the result image. Must be
      &lt;= <a href=
      "constants.html#Miscellaneous_constants">MaxRGB</a>.</dd>

      <dt>colorspace</dt>

      <dd class="imquote">The <a href=
      "constants.html#ColorspaceType">colorspace</a> to quantize
      in. Color reduction, by default, takes place in the RGB color
      space.&nbsp; Empirical evidence&nbsp;suggests that distances
      in color spaces such as YUV or YIQ&nbsp; correspond&nbsp;
      to&nbsp; perceptual&nbsp; color differences more closely
      than&nbsp; do distances in RGB space. The Transparent color
      space behaves uniquely in that it preserves the matte channel
      of the image if it exists.</dd>

      <dt>dither</dt>

      <dd class="imquote">Set to <code>true</code> to apply
      Floyd/Steinberg error diffusion to the image. When the size
      of the color palette is less than the image colors, this
      trades off spacial resolution for color resolution by
      dithering to achieve a similar looking image.</dd>

      <dt>tree_depth</dt>

      <dd class="imquote">The tree depth to use while quantizing.
      The values 0 and 1 support automatic tree depth
      determination. The tree depth may be forced via values
      ranging from 2 to 8. The ideal tree depth depends on the
      characteristics of the input image, and may be determined
      through experimentation.</dd>

      <dt>measure_error</dt>

      <dd class="imquote">Set to <code>true</code> to calculate
      quantization errors when quantizing the image.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>See the example for <a href=
    "image1.html#colorize">colorize</a>.</p>

    <h4>See also</h4>

    <p><a href="image2.html#ordered_dither">ordered_dither</a>,
    <a href="image2.html#posterize">posterize</a>, <a href=
    "ilist.html#quantize">ImageList#quantize</a></p>

    <h4>Magick API</h4>

    <p>QuantizeImage</p>
  </div>

  <div class="sig">
    <h3 id="quantum_operator">quantum_operator</h3>

    <p><span class="arg">image</span>.quantum_operator(<span class=
    "arg">operator</span>, <span class="arg">rvalue</span>,
    <span class="arg">channel</span>=AllChannels) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Performs the requested integer arithmetic operation on the
    selected channel of the image. This method allows simple
    arithmetic operations on the component values of all pixels in
    an image. Of course, you could also do this in Ruby using
    <a href="image2.html#get_pixels">get_pixels</a> and <a href=
    "#store_pixels">store_pixels</a>, or <a href="#view">view</a>,
    but <code>quantum_operator</code> will be faster, especially
    for large numbers of pixels, since it does not need to convert
    the pixels from C to Ruby.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>operator</dt>

      <dd>
        One of the following <code>QuantumExpressionOperator</code>
        constants:

        <ul id="quantum_op_list">
          <li>AddQuantumOperator</li>

          <li><code>AndQuantumOperator</code></li>

          <li><code>DivideQuantumOperator</code></li>

          <li><code>LShiftQuantumOperator</code></li>

          <li><code>MaxQuantumOperator<sup>*</sup></code></li>

          <li><code>MinQuantumOperator<sup>*</sup></code></li>

          <li><code>MultiplyQuantumOperator</code></li>

          <li><code>OrQuantumOperator</code></li>

          <li><code>RShiftQuantumOperator</code></li>

          <li><code>SubtractQuantumOperator</code></li>

          <li><code>XorQuantumOperator</code></li>
        </ul><sup>*</sup> Available in ImageMagick 6.2.0 and later.
      </dd>

      <dt>rvalue</dt>

      <dd>a <code>Numeric</code> operation rvalue.</dd>

      <dt>channel</dt>

      <dd>A <a href="constants.html#ChannelType">ChannelType</a>
      value. The default is to operate on all channels.</dd>
    </dl>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Example</h4>

    <p>Divide the red component of all the pixels in the image by
    2:</p>
    <pre>
img.quantum_operator(DivideQuantumOperator, 2, RedChannel)
</pre>

    <h4>See also</h4>

    <p>The <a href="struct.html#view">Image:View</a> class supports
    operations on individual pixels and collections of pixels, as
    well as operations on channels within pixels. See <a href=
    "#view">view</a>, below.</p>

    <h4>Magick API</h4>QuantumOperatorRegionImage (GraphicsMagick
    1.1), EvaluateImageChannel (ImageMagick)
  </div>

  <div class="sig">
    <h3 id="radial_blur">radial_blur</h3>

    <p><span class="arg">image</span>.radial_blur(<span class=
    "arg">aFloat</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Applies a radial blur to the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>angle</dt>

      <dd>Amount of blur, in degrees</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('radial_blur.rb.html')"><img src=
    "ex/radial_blur.jpg" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/radial_blur.jpg'" alt="radial_blur example"
    title="Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image1.html#blur_image">blur_image</a>, <a href=
    "image2.html#gaussian_blur">gaussian_blur</a>, <a href=
    "image2.html#motion_blur">motion_blur</a>, <a href=
    "#radial_blur_channel">radial_blur_channel</a></p>

    <h4>Magick API</h4>

    <p>RadialBlurImage</p>
  </div>

  <div class="sig">
    <h3 id="radial_blur_channel">radial_blur_channel</h3>

    <p><span class=
    "arg">image</span>.radial_blur_channel(<span class=
    "arg">aFloat</span> [, <span class="arg">channel</span>...])
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Applies a radial blur to the selected image channels.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>angle</dt>

      <dd>Amount of blur, in degrees</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are blurred.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#radial_blur">radial_blur</a></p>

    <h4>Magick API</h4>

    <p>RadialBlurImageChannel (available in ImageMagick 6.2.4)</p>
  </div>

  <div class="sig">
    <h3 id="raise">raise</h3>

    <p><span class="arg">image</span>.raise(<span class=
    "arg">width</span>=6, <span class="arg">height</span>=6,
    <span class="arg">raised</span>=<code>true</code>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Creates a simulated three-dimensional
    button-like effect by lightening and darkening the edges of the
    image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>width</dt>

      <dd>The width of the raised edge in pixels. The default is
      6.</dd>

      <dt>height</dt>

      <dd>The height of the raised edge in pixels. The default is
      6.</dd>

      <dt>raised</dt>

      <dd>If <code>true</code>, the image is raised, otherwise
      lowered.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('raise.rb.html')"><img src="ex/raise.jpg"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/raise.jpg'" alt="raise example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>RaiseImage</p>
  </div>

  <div class="sig">
    <h3 id="random_threshold_channel">random_threshold_channel</h3>

    <p><span class="arg">image</span>.random_threshold_channel(
    <span class="arg">thresholds</span>, [<span class=
    "arg">channel</span>...] ) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Changes the value of individual pixels based
    on the intensity of each pixel compared to a random threshold.
    The result is a low-contrast, two color image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>thresholds</dt>

      <dd><span class="imquote">A geometry string containing
      LOWxHIGH thresholds.</span> The string is in the form `XxY'.
      The Y value may be omitted, in which case it is assigned the
      value MaxRGB-X. If an % appears in the string then the values
      are assumed to be percentages of MaxRGB. <span class=
      "imquote">If the string contains 2x2, 3x3, or 4x4, then an
      ordered dither of order 2, 3, or 4 will be performed
      instead.</span> A <a href="struct.html#Geometry">Geometry</a>
      object may be used as well.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are
      thresholded.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
geom = Geometry.new(MaxRGB/2)
random_threshold_channel(geom, RedChannel)
</pre>

    <p class="rollover"><a href=
    "javascript:popup('random_threshold_channel.rb.html')"><img src="ex/random_threshold_channel.jpg"
    alt="random_threshold_channel example" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/random_threshold_channel.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href=
    "image1.html#adaptive_threshold">adaptive_threshold</a>,
    <a href="image1.html#bilevel_channel">bilevel_channel</a>,
    <a href="#threshold">threshold</a></p>

    <h4>Magick API</h4>

    <p>RandomThresholdImageChannel</p>
  </div>

  <div class="sig">
    <h3 id="recolor">recolor</h3>

    <p><span class="arg">image</span>.recolor(<span class=
    "arg">color_matrix</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Use this method to <span class="imquote">translate, scale,
    shear, or rotate image colors. Although you can use variable
    sized matrices, typically you use a 5&times;5 for an RGBA image
    and a 6&times;6 for CMYKA. Populate the last row with
    normalized values to translate.</span></p>

    <h4>Arguments</h4>

    <p>An array of Float values representing the recolor
    matrix.</p>

    <h4>Magick API</h4>

    <p>RecolorImage (introduced in ImageMagick 6.3.1)</p>
  </div>

  <div class="sig">
    <h3 id="reduce_noise">reduce_noise</h3>

    <p><span class="arg">image</span>.reduce_noise(<span class=
    "arg">radius</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Smooths the contours of an image while still
    preserving edge information. The algorithm works by replacing
    each pixel with its neighbor closest in value.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius</dt>

      <dd class="imquote">A neighbor is defined by radius. Use a
      radius of 0 and <code>reduce_noise</code> selects a suitable
      radius for you.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>The left side of the image has been modified by <a href=
    "#Image.add_noise"><code>add_noise</code></a>. The right side
    has been filtered by <code>reduce_noise(0)</code>.</p>

    <p><a href="javascript:popup('reduce_noise.rb.html')"><img src=
    "ex/reduce_noise.jpg" title="Click to see the example script"
    alt="reduce_noise example" /></a></p>

    <h4>See also</h4>

    <p><a href="image2.html#enhance">enhance</a>, <a href=
    "#unsharp_mask">unsharp_mask</a></p>

    <h4>Magick API</h4>

    <p>ReduceNoiseImage</p>
  </div>

  <div class="sig">
    <h3 id="resample">resample</h3>

    <p><span class="arg">image</span>.resample(<span class=
    "arg">horizontal_res</span>=72.0[, <span class=
    "arg">vertical_res</span>]) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Resample image to specified horizontal and
    vertical resolution.</p>

    <p><span class="imquote">Resize the image so that its rendered
    size remains the same as the original at the specified target
    resolution. For example, if a 300 DPI image renders at 3 inches
    by 2 inches on a 300 DPI device, when the image has been
    resampled to 72 DPI, it will render at 3 inches by 2 inches on
    a 72 DPI device. Note that only a small number of image formats
    (e.g. JPEG, PNG, and TIFF) are capable of storing the image
    resolution. For formats which do not support an image
    resolution, the original resolution of the image must be
    specified via</span> the <a href=
    "imageattrs.html#density">density</a> attribute <span class=
    "imquote">prior to specifying the resample
    resolution.</span></p>

    <h4>Arguments</h4>

    <dl>
      <dt>horizontal_res</dt>

      <dd>the target horizontal resolution. The default is
      72.0.</dd>

      <dt>vertical_res</dt>

      <dd>the target vertical resolution. The default is
      <span class="arg">horizontal_res</span>.</dd>
    </dl>
  </div>

  <div class="sig">
    <h3 id="resize">resize</h3>

    <p><span class="arg">image</span>.resize(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>,
    <em>filter</em>=<a href=
    "constants.html#FilterType">LanczosFilter</a>,
    <em>support</em>=1.0) -&gt; <em>image</em><br />
    <span class="arg">image</span>.resize(<span class=
    "arg">scale_factor</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Changes the size of the receiver to the specified
    dimensions.</p>

    <h4>Arguments</h4>

    <p>You can specify the new size in two ways. Either specify the
    new width and height explicitly, or specify a <em>scale
    factor</em>, a number that represents the percentage
    change.</p>

    <p>Use the <a href=
    "image1.html#change_geometry">change_geometry</a> method to
    resize an image with constraints such as "maintain the current
    proportions."</p>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The desired width and height.</dd>

      <dt>filter</dt>

      <dd>The <a href="constants.html#FilterType">filter</a> to use
      when resizing. If you do not specify a filter argument,
      resize uses the value of the receiver's <a href=
      "imageattrs.html#Image.filter">filter attribute</a>.
      <span class="imquote">Most of the filters are FIR (finite
      impulse response), however, Bessel, Gaussian, and Sinc are
      IIR (infinite impulse response). Bessel and Sinc are windowed
      (brought down to zero) with the Blackman filter.</span></dd>

      <dt>support</dt>

      <dd>Values &gt; 1 increase the blurriness. Values &lt; 1
      increase the sharpness. If this argument is not specified,
      <code>resize</code> uses the value of the receiver's <a href=
      "imageattrs.html#Image.blur">blur</a> attribute.</dd>

      <dt>scale_factor</dt>

      <dd>You can use this argument instead of specifying the
      desired width and height. The percentage size change. For
      example, 1.25 makes the new image 125% of the size of the
      receiver. The scale factor 0.5 makes the new image 50% of the
      size of the receiver.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image1.html#change_geometry">change_geometry</a>,
    <a href="#resize_bang">resize!</a>, <a href=
    "image2.html#magnify">magnify</a>, <a href=
    "image2.html#minify">minify</a>, <a href="#sample">sample</a>,
    <a href="#scale">scale</a>, <a href=
    "thumbnail">thumbnail</a></p>

    <h4>Magick API</h4>

    <p>ResizeImage</p>
  </div>

  <div class="sig">
    <h3 id="resize_bang">resize!</h3>

    <p><em>image</em>.resize!(<em>new_width</em>,
    <em>new_height</em>, <em>filter</em>=<a href=
    "constants.html#FilterType">LanczosFilter</a>,
    <em>support</em>=1.0) -&gt; <em>image</em><br />
    <span class="arg">image</span>.resize!(<span class=
    "arg">scale_factor</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#resize">resize</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="resize_to_fit">resize_to_fit</h3>

    <p><em>image</em>.resize_to_fit(<em>new_width</em>,
    <em>new_height</em>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>A convenience method. Resize the image to fit within the
    specified dimensions while retaining the original aspect
    ratio.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The maximum width and height of the resized image. In
      order to retain the aspect ratio of the input image, the
      actual dimensions of the resized image may be different but
      will not be larger than the specified values.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4><a href=
    "image1.html#change_geometry">change_geometry</a>, <a href=
    "#resize">resize</a>
  </div>

  <div class="sig">
    <h3 id="resize_to_fit_bang">resize_to_fit!</h3>

    <p><em>image</em>.resize_to_fit!(<em>new_width</em>,
    <em>new_height</em>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href=
    "#resize_to_fit">resize_to_fit</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="roll">roll</h3>

    <p><span class="arg">image</span>.roll(<span class=
    "arg">x_offset</span>, <span class="arg">y_offset</span>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Offsets an image as defined by <span class=
    "arg">x_offset</span> and <span class=
    "arg">y_offset</span>.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x_offset</dt>

      <dd>The number of columns to offset the image.</dd>

      <dt>y_offset</dt>

      <dd>The number of rows to offset the image.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>This image has been offset 25% in both directions.</p>

    <p class="rollover"><a href=
    "javascript:popup('roll.rb.html')"><img src="ex/roll.jpg"
    title="Click to see the example script" alt="roll example"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/roll.jpg'" /></a><img src="ex/images/spin.gif"
    alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>RollImage</p>
  </div>

  <div class="sig">
    <h3 id="rotate">rotate</h3>

    <p><span class="arg">image</span>.rotate(<span class=
    "arg">amount</span> [, <span class="arg">qualifier</span>])
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Rotate the receiver by the specified angle. Positive angles
    rotate clockwise while negative angles rotate
    counter-clockwise. New pixels introduced by the rotation are
    the same color as the current <a href=
    "imageattrs.html#background_color">background color</a>. Set
    the background color to "none" to make the new pixels
    transparent black.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>amount</dt>

      <dd>The number of degrees to rotate the image.</dd>

      <dt>qualifier</dt>

      <dd>If present, either "&gt;" or "&lt;". If "&gt;", rotates
      the image only if the image's width exceeds its height. If
      "&lt;" rotates the image only if its height exceeds its
      width. If this argument is omitted the image is always
      rotated.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image, or <code>nil</code> if the image was not
    rotated because it did not meet the qualification specified by
    the second argument.</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('rotate_f.rb.html')"><!--
                                                                    This img tag displays the original image when the mouse is over.
                                                                    Use CSS to add padding around the image to make it occupy the
                                                                    same space as the rotated image. --><img style="padding-top:34px;padding-bottom:34px; display:none"
    id="notrotated" onmouseout=
    "this.style.display='none'; rotated.style.display='';" src=
    "ex/images/Flower_Hat.jpg" alt="rotate example" title=
    "Click to see the example script"  /><!--
                                                                      This img tag displays the rotated image.
                                                                      --><img class="hide"
    id="rotated" onmouseover=
    "this.style.display='none'; notrotated.style.display='';" src=
    "ex/rotate_f.jpg" alt="rotate example"  /></a>
    <img src="ex/images/spin.gif" alt="" class="spin" style=
    "left:322px;" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image1.html#affine_transform">affine_transform</a>,
    <a href="#shear">shear</a></p>

    <h4>Magick API</h4>

    <p>RotateImage</p>
  </div>

  <div class="sig">
    <h3 id="rotate_bang">rotate!</h3>

    <p><span class="arg">image</span>.rotate!(<span class=
    "arg">amount</span> [, <span class="arg">qualifier</span>])
    -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#rotate">rotate</a>.</p>

    <h4>Returns</h4>

    <p>self, or <code>nil</code> if the image was not rotated
    because it did not meet the qualification specified by the
    second argument.</p>
  </div>

  <div class="sig">
    <h3 id="sample">sample</h3>

    <p><span class="arg">image</span>.sample(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <span class="arg">anImage</span><br />
    <span class="arg">image</span>.sample(<span class=
    "arg">scale_factor</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Scales an image to the desired dimensions with pixel
    sampling. Unlike other scaling methods, this method does not
    introduce any additional color into the scaled image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The desired width and height.</dd>

      <dt>scale_factor</dt>

      <dd>You can use this argument instead of specifying the
      desired width and height. The percentage size change. For
      example, 1.25 makes the new image 125% of the size of the
      receiver. The scale factor 0.5 makes the new image 50% of the
      size of the receiver.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#sample_bang">sample!</a>, <a href=
    "image2.html#magnify">magnify</a>, <a href=
    "image2.html#minify">minify</a>, <a href="#resize">resize</a>,
    <a href="#scale">scale</a>, <a href=
    "#thumbnail">thumbnail</a></p>

    <h4>Magick API</h4>

    <p>SampleImage</p>
  </div>

  <div class="sig">
    <h3 id="sample_bang">sample!</h3>

    <p><span class="arg">image</span>.sample!(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>image</em><br />
    <span class="arg">image</span>.sample!(<span class=
    "arg">scale_factor</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#sample">sample</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="scale">scale</h3>

    <p><span class="arg">image</span>.scale(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>anImage</em><br />
    <span class="arg">image</span>.scale(<span class=
    "arg">scale_factor</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Changes the size of an image to the given
    dimensions.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The desired width and height.</dd>

      <dt>scale_factor</dt>

      <dd>You can use this argument instead of specifying the
      desired width and height. The percentage size change. For
      example, 1.25 makes the new image 125% of the size of the
      receiver. The scale factor 0.5 makes the new image 50% of the
      size of the receiver.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#scale_bang">scale!</a>, <a href=
    "image2.html#magnify">magnify</a>, <a href=
    "image2.html#minify">minify</a>, <a href="#resize">resize</a>,
    <a href="#sample">sample</a>, <a href=
    "#thumbnail">thumbnail</a></p>

    <h4>Magick API</h4>

    <p>ScaleImage</p>
  </div>

  <div class="sig">
    <h3 id="scale_bang">scale!</h3>

    <p><span class="arg">image</span>.scale!(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>image</em><br />
    <span class="arg">image</span>.scale!(<span class=
    "arg">scale_factor</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#Image.scale">scale</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="segment">segment</h3>

    <p>image.segment(<span class=
    "arg">colorspace</span>=RGBColorspace, <span class=
    "arg">cluster_threshold</span>=1.0, <span class=
    "arg">smoothing_threshold</span>=1.5, <span class=
    "arg">verbose</span>=<code>false</code>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Segments an image by analyzing the
    histograms of the color components and identifying units that
    are homogeneous with the fuzzy c-means technique.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>colorspace</dt>

      <dd>A <a href=
      "constants.html#ColorspaceType"><code>ColorspaceType</code></a>
      value. <span class="imquote">Empirical evidence suggests that
      distances in YUV or YIQ correspond to perceptual color
      differences more closely than do distances in RGB space. The
      image is then returned to RGB colorspace after color
      reduction.</span></dd>

      <dt>cluster_threshold</dt>

      <dd class="imquote">The number of pixels in each cluster must
      exceed the the cluster threshold to be considered valid.</dd>

      <dt>smoothing_threshold</dt>

      <dd>The <span class="imquote">smoothing threshold eliminates
      noise in the second derivative of the histogram. As the value
      is increased, you can expect a smoother second
      derivative.</span></dd>

      <dt>verbose</dt>

      <dd>If <code>true</code>, <code>segment</code> prints
      detailed information about the identified classes.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p><code>segment(Magick::YUVColorspace, 0.4, 0.4)</code></p>

    <p class="rollover"><a href=
    "javascript:popup('segment.rb.html')"><img src="ex/segment.jpg"
    alt="segment example" title="Click to see the example script"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/segment.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>SegmentImage</p>
  </div>

  <div class="sig">
    <h3 id="sepiatone">sepiatone</h3>

    <p><span class="arg">image</span>.sepiatone(<span class=
    "arg">threshold</span>=MaxRGB) -&gt; <span class=
    "arg">anImage</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Applies a special effect to the image,
    similar to the effect achieved in a photo darkroom by sepia
    toning.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>threshold</dt>

      <dd class="imquote"><span class="arg">Threshold</span> ranges
      from 0 to <code>MaxRGB</code> and is a measure of the extent
      of the sepia toning. A threshold of 80% is a good starting
      point for a reasonable tone. The default is MaxRGB.</dd>
    </dl>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('sepiatone.rb.html')"><img src=
    "ex/sepiatone.jpg" alt="sepiatone example" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/sepiatone.jpg'" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p>You can get more control by using <a href=
    "image1.html#colorize">colorize</a>.</p>

    <h4>Magick API</h4>

    <p>SepiaToneImage (available in ImageMagick 6.2.1)</p>
  </div>

  <div class="sig">
    <h3 id="set_channel_depth">set_channel_depth</h3>

    <p><span class=
    "arg">image.</span>set_channel_depth(<span class="arg">channel</span>,
    <span class="arg">depth</span>) -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Sets the depth of the image channel.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>channel</dt>

      <dd>A <a href="constants.html#ChannelType">ChannelType</a>
      value</dd>

      <dt>depth</dt>

      <dd>The desired depth (must be no greater than <a href=
      "constants.html">QuantumDepth</a>)</dd>
    </dl>

    <h4>Returns</h4>

    <p>self</p>

    <h4>See also</h4>

    <p><a href="image1.html#channel_depth">channel_depth</a></p>

    <h4>Magick API</h4>

    <p>SetImageChannelDepth</p>
  </div>

  <div class="sig">
    <h3 id="shade">shade</h3>

    <p><span class="arg">image</span>.shade(<span class=
    "arg">shading</span>=<code>false</code>, <span class=
    "arg">azimuth</span>=30, <span class="arg">elevation</span>=30)
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Shines a distant light on an image to create
    a three-dimensional effect. You control the positioning of the
    light with <span class="arg">azimuth</span> and <span class=
    "arg">elevation</span>; <span class="arg">azimuth</span> is
    measured in degrees off the x axis and <span class=
    "arg">elevation</span> is measured in pixels above the Z
    axis.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>shading</dt>

      <dd>If <code>true</code>, <code>shade</code> shades the
      intensity of each pixel.</dd>

      <dt>azimuth, elevation</dt>

      <dd>The light source direction. The azimuth is measured in
      degrees. 0&deg; is at 9 o'clock. Increasing values move the
      light source counter-clockwise.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p><code>shade(true, 50, 50)</code></p>

    <p class="rollover"><a href=
    "javascript:popup('shade.rb.html')"><img src="ex/shade.jpg"
    alt="shade example" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/shade.jpg'" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>ShadeImage</p>
  </div>

  <div class="sig">
    <h3 id="shadow">shadow</h3>

    <p><span class="arg">image</span>.shadow(<span class=
    "arg">x_offset=4</span>, <span class="arg">y_offset=4</span>,
    <span class="arg">sigma=4.0</span>, <span class=
    "arg">opacity=1.0</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>Draws the shadow of opaque parts of the
    image. This method only works when the image has opaque parts
    and transparent parts. Note that the resulting image is just
    the shadow. You must composite the original image over the
    shadow to produce the shadowed results.

    <h4>Arguments</h4>

    <dl>
      <dt>x_offset</dt>

      <dd>The shadow x-offset</dd>

      <dt>y_offset</dt>

      <dd>The shadow y-offset</dd>

      <dt>sigma</dt>

      <dd>The standard deviation of the Gaussian operator used to
      produce the shadow. The higher the number, the "blurrier" the
      shadow, but the longer it takes to produce the shadow. Must
      be &gt; 0.0.</dd>

      <dt>opacity</dt>

      <dd>The percent opacity of the shadow. May be either a number
      between 0.1 and 1.0, or a string in the form "NN%" between
      "1%" and "100%". If the percentage is greater than 100 it is
      reduced to 100.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('shadow.rb.html')">
    <!-- This img tag displays the original image when the mouse is over -->
     <img style="padding:8px; display:none" id="shadowless"
    onmouseout=
    "this.style.display='none';shadowed.style.display='';" src=
    "ex/shadow_before.gif" alt="shadow example" title=
    "Click to see the example script"  /><!--
                                                          This img tag displays the shadowed image when the mouse is not over
                                                          --><img class="hide"
    id="shadowed" onmouseover=
    "this.style.display='none';shadowless.style.display='';" src=
    "ex/shadow_after.gif" alt="shadow example"
    /></a> <img src="ex/images/spin.gif" alt="" style=
    "margin-bottom: 120px" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>ShadowImage (available in ImageMagick 6.1.7)</p>

    <h4>Notes</h4>

    <p>The shadow image is 2&times;<span class="arg">sigma</span>
    pixels larger on a side than the original image, as can be seen
    in the example above.</p>
  </div>

  <div class="sig">
    <h3 id="sharpen">sharpen</h3>

    <p><span class="arg">image</span>.sharpen(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0)
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Sharpens an image. We convolve the image
    with a Gaussian operator of the given <span class=
    "arg">radius</span> and standard deviation (<span class=
    "arg">sigma</span>). For reasonable results, <span class=
    "arg">radius</span> should be larger than <span class=
    "arg">sigma</span>. Use a radius of 0 and <code>sharpen</code>
    selects a suitable radius for you.</p>

    <h4>Arguments</h4>

    <p>The radius and standard deviation of the Gaussian
    operator.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>SharpenImage</p>

    <h4>See also</h4>

    <p><a href=
    "imageattrs.html#virtual_pixel_method">virtual_pixel_method</a></p>
  </div>

  <div class="sig">
    <h3 id="sharpen_channel">sharpen_channel</h3>

    <p><span class="arg">image</span>.sharpen_channel( <span class=
    "arg">radius</span>, <span class="arg">sigma</span>
    [,<span class="arg">channel</span>...] ) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Sharpens one or more image channels. We
    convolve the image with a Gaussian operator of the given radius
    and standard deviation (<span class="arg">sigma</span>) . For
    reasonable results, <span class="arg">radius</span> should be
    larger than <span class="arg">sigma</span>. Use a radius of 0
    and <code>sharpen_channel</code> selects a suitable radius for
    you.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius, sigma</dt>

      <dd>The radius and standard deviation of the Gaussian
      operator.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are sharpened.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="#sharpen">sharpen</a></p>

    <h4>Magick API</h4>

    <p>SharpenImageChannel (available in ImageMagick 6.0.1)</p>
  </div>

  <div class="sig">
    <h3 id="shave">shave</h3>

    <p><span class="arg">image</span>.shave(<span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Removes pixels from the edges of the image, leaving the
    center rectangle.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>width</dt>

      <dd>The number of pixels to remove from each side of the
      receiver, not to exceed half the original width.</dd>

      <dt>height</dt>

      <dd>The number of pixels to remove from the top and bottom of
      the receiver, not to exceed half the original height.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('shave.rb.html')"><img src="ex/shave.jpg"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/shave.jpg'" alt="shave example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="#shave_bang">shave!</a>, <a href=
    "image1.html#crop">crop</a></p>

    <h4>Magick API</h4>

    <p>ShaveImage</p>
  </div>

  <div class="sig">
    <h3 id="shave_bang">shave!</h3>

    <p><span class="arg">image</span>.shave!(<span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#Image.shave">shave</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="shear">shear</h3>

    <p><span class="arg">image</span>.shear(<span class=
    "arg">x_shear</span>, <span class="arg">y_shear</span>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">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,
    <span class="arg">x_shear</span> is measured relative to the Y
    axis, and similarly, for Y direction shears <span class=
    "arg">y_shear</span> is measured relative to the X axis. Empty
    triangles left over from shearing the image are filled with the
    background color.</p>

    <h4>Arguments</h4>

    <p>The X and Y shear angles, measured in degrees. These values
    must not be 180.0. If either value is 0, no shearing will
    occur.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('shear.rb.html')"><!--
                                                                      This img tag displays the original image when the mouse is over
                                                                      --><img style="padding-top:34px; padding-bottom:33px; padding-left:49px; padding-right:49px; display:none"
    id="noshear" onmouseout=
    "this.style.display='none'; sheared.style.display='';" src=
    "ex/images/Flower_Hat.jpg" alt="shear example" title=
    "Click to see the example script"  /> <!--
                                                                       This img tag displays the sheared image when the mouse is not over
                                                                       -->
     <img id="sheared" onmouseover=
    "this.style.display='none'; noshear.style.display='';" src=
    "ex/shear.jpg" alt="shear example"
    /></a><img src="ex/images/spin.gif" alt="" class=
    "spin" style="left: 253px; top: 34px" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image1.html#affine_transform">affine_transform</a>,
    <a href="#rotate">rotate</a></p>

    <h4>Magick API</h4>

    <p>ShearImage</p>
  </div>

  <div class="sig">
    <h3 id="sigmoidal_contrast_channel">
    sigmoidal_contrast_channel</h3>

    <p><br />
    <span class=
    "arg">image</span>.sigmoidal_contrast_channel(<span class=
    "arg">contrast</span>=3.0, <span class=
    "arg">midpoint</span>=50.0, <span class=
    "arg">sharpen</span>=false[,<span class=
    "arg">channel</span>...]) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Adjusts the contrast of an image channel
    with a non-linear sigmoidal contrast algorithm. Increases the
    contrast of the image using a sigmoidal transfer function
    without saturating highlights or shadows.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>contrast</dt>

      <dd class="imquote">indicates how much to increase the
      contrast (0 is none; 3 is typical; 20 is pushing it)</dd>

      <dt>midpoint</dt>

      <dd class="imquote">indicates where midtones fall in the
      resultant image (0 is white; 50% is middle-gray; 100% is
      black)</dd>

      <dt>sharpen</dt>

      <dd class="imquote">Set <span class="arg">sharpen</span> to
      <code>true</code> to increase the image contrast otherwise
      the contrast is reduced.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are adjusted.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image1.html#contrast">contrast</a></p>

    <h4>Magick API</h4>

    <p>SigmoidalContrastImageChannel (available in ImageMagick
    6.2.1)</p>
  </div>

  <div class="sig">
    <h3 id="signature">signature</h3>

    <p><span class="arg">image</span>.signature -&gt;
    <em>aString</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Computes a message digest from an image
    pixel stream with an implementation of the NIST SHA-256 Message
    Digest algorithm. This signature uniquely identifies the image
    and is convenient for determining if an image has been modified
    or whether two images are identical.</p>

    <p>&times;Magick adds the computed signature to the image's
    properties.</p>

    <h4>Returns</h4>

    <p>The signature as a 64-character string.</p>

    <h4>Example</h4>
    <pre>
img = Image.read('ex/images/Flower_Hat.jpg').first &raquo;
  ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
img.properties &raquo;
  {"comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
img.signature &raquo;
  "485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b"
img.properties &raquo;
  {"signature"=&gt;"485e01ecba1a1f47924d67b887cb07b474f695841733796dfa3c2876965c7e8b",
   "comment"=&gt;"File written by Adobe Photoshop\250 4.0"}
</pre>

    <h4>See also</h4>

    <p><a href="image1.html#spaceship">&lt;=&gt;</a>, <a href=
    "image1.html#difference">difference</a></p>

    <h4>Magick API</h4>

    <p>SignatureImage</p>
  </div>

  <div class="sig">
    <h3 id="sketch">sketch</h3>

    <p><span class="arg">image</span>.sketch(<span class=
    "arg">radius</span>=0.0, <span class="arg">sigma</span>=1.0,
    <span class="arg">angle</span>=0.0) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Simulates a pencil sketch. For best results start with a
    grayscale image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>radius, sigma</dt>

      <dd>The radius and sigma of the Gaussian operator</dd>

      <dt>angle</dt>

      <dd>The angle toward which the image is sketched.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('sketch.rb.html')"><img src="ex/sketch.jpg"
    title="Click to see the example script" alt="sketch example"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/sketch.jpg'" /></a> <img src="ex/images/spin.gif"
    alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>SketchImage (available in ImageMagick 6.2.8)</p>
  </div>

  <div class="sig">
    <h3 id="solarize">solarize</h3>

    <p><span class="arg">image</span>.solarize(<span class=
    "arg">threshold</span>=50) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Applies a special effect to the image
    similar to the effect achieved in a photo darkroom by
    selectively exposing areas of photo sensitive paper to
    light.</p>

    <h4>Arguments</h4>

    <p><span class="imquote">Ranges from 0 to MaxRGB and is a
    measure of the extent of the solarization.</span> The default
    is 50.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('solarize.rb.html')"><img src=
    "ex/solarize.jpg" title="Click to see the example script" alt=
    "solarize example" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/solarize.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>SolarizeImage</p>
  </div>

  <div class="sig">
    <h3 id="splice">splice</h3>

    <p><span class="arg">image</span>.splice(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">width</span>, <span class="arg">height</span>[,
    <span class="arg">color</span>]) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Splice a solid color into the image as defined by the
    <code>x</code>, <code>y</code>, <code>width</code>, and
    <code>height</code> arguments. This method is the opposite of
    <a href="image1.html#chop">chop</a>.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y, width, height</dt>

      <dd>Describe the rectangle to be spliced.</dd>

      <dt>color</dt>

      <dd>The color to be spliced. Either a <a href=
      "imusage.html#color_names">color name</a> or a <a href=
      "struct.html#Pixel">pixel</a>. If omitted, uses the image's
      background color.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('splice.rb.html')">
    <!-- This img tag displays the original image when the mouse is over -->
     <img style=
    "padding-left:8px;padding-right:8px;padding-bottom:10px;padding-bottom:10px; display:none"
    id="nosplice" onmouseout=
    "this.style.display='none';spliced.style.display='';" src=
    "ex/images/Flower_Hat.jpg" alt="splice example" title=
    "Click to see the example script"  /><!--
                                                                                                                This img tag displays the spliced image when the mouse is not over
                                                                                                                --><img class="hide"
    id="spliced" onmouseover=
    "this.style.display='none';nosplice.style.display='';" src=
    "ex/splice.jpg" alt="splice example"  /></a>
    <img src="ex/images/spin.gif" alt="" style=
    "margin-bottom: 280px" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href=
    "image1.html#color_fill_to_border">color_fill_to_border</a>,
    <a href="image1.html#color_floodfill">color_floodfill</a>,
    <a href="image1.html#color_reset_bang">color_reset!</a>,
    <a href="image2.html#color_reset_bang">erase!</a>, <a href=
    "image2.html#opaque">opaque</a></p>

    <h4>Magick API</h4>

    <p>SpliceImage</p>
  </div>

  <div class="sig">
    <h3 id="spread">spread</h3>

    <p><span class="arg">image</span>.spread(<span class=
    "arg">radius</span>=3) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Randomly displaces each pixel in a block
    defined by the <span class="arg"><em>radius</em></span>
    parameter.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('spread.rb.html')"><img src="ex/spread.jpg"
    alt="spread example" title="Click to see the example script"
    onmouseover="this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/spread.jpg'" /></a> <img src="ex/images/spin.gif"
    alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>SpreadImage</p>
  </div>

  <div class="sig">
    <h3 id="statistics">statistics</h3>

    <p><span class="arg">image</span>.statistics -&gt; <em>see
    below</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Computes the minimum, maximum, mean, standard deviation, and
    variance for each channel in the image.</p>

    <h4>Returns</h4>

    <p>The statistics method returns a <code>Statistics</code>
    class object. This class defines four <em>channel</em>
    attributes: <code>red</code>, <code>green</code>,
    <code>blue</code>, and <code>opacity</code>. Each channel
    attribute is a <code>Statistics::Channel</code> class object.
    This class defines 5 <em>statistic</em> attributes:
    <code>min</code>, <code>max</code>, <code>mean</code>
    <code>stddev</code>, and <code>var</code>. See the example
    below.</p>

    <h4>Example</h4>
    <pre>
require 'pp'

img = Image.read("Flower_Hat.jpg").first
stats = img.statistics

pp stats &raquo;
    #&lt;Magick::Statistics
    red=
      #&lt;Magick::Statistics::Channel
      max=1.0,
      min=0.0,
      mean=0.627182352941187,
      stddev=0.231399683489667,
      var=0.0535458135191179&gt;,
    green=
      #&lt;Magick::Statistics::Channel
      max=1.0,
      min=0.0,
      mean=0.571999607843132,
      stddev=0.22246563644744,
      var=0.0494909593999647&gt;,
    blue=
      #&lt;Magick::Statistics::Channel
      max=1.0,
      min=0.0,
      mean=0.508869725490209,
      stddev=0.269422111063184,
      var=0.0725882739297426&gt;,
    opacity=
      #&lt;Magick::Statistics::Channel
      max=0.0,
      min=0.0,
      mean=0.0,
      stddev=0.0,
      var=0.0&gt;&gt;

p stats.red.stddev &raquo; 0.231399683489667
</pre>

    <h4>See also</h4>

    <p><a href="image1.html#channel_extrema">channel_extrema</a>,
    <a href="image1.html#channel_mean">channel_mean</a></p>

    <h4>Magick API</h4>GetImageStatistics (available in
    GraphicsMagick 1.1)
  </div>

  <div class="sig">
    <h3 id="stegano">stegano</h3>

    <p><span class="arg">image</span>.stegano(<span class=
    "arg">watermark</span>, <span class="arg">offset</span>) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Hides a digital watermark in the receiver. You can retrieve
    the watermark by reading the file with the
    <code>stegano:</code> prefix, thereby proving the authenticity
    of the file.</p>

    <p>The watermarked image must be saved in a lossless RGB format
    such as MIFF, or PNG. You cannot save a watermarked image in a
    lossy format such as JPEG or a pseudocolor format such as GIF.
    Once written, the file must not be modified or processed in any
    way.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>watermark</dt>

      <dd>An image or imagelist to be used as the watermark. The
      watermark must be grayscale and should be substantially
      smaller than the receiver. The recovery time is proportional
      to the size of the watermark.</dd>

      <dt>offset</dt>

      <dd>The starting position within the receiver at which the
      watermark will be hidden. When you retrieve the watermark
      from the file, you must supply this value, along with the
      width and height of the watermark, in the <a href=
      "info.html#Info.size_eq">size</a> optional parameter to the
      <a href="#Image.read">read</a> method.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A copy of the image containing the embedded watermark.</p>

    <h4>Example</h4>

    <p><a href="javascript:popup('stegano.rb.html')"><img src=
    "ex/stegano.gif" title="Click to see the example script" alt=
    "stegano example" /></a></p>

    <h4>Magick API</h4>

    <p>SteganoImage</p>

    <h4>See also</h4>

    <p><a href="#watermark">watermark</a></p>
  </div>

  <div class="sig">
    <h3 id="stereo">stereo</h3>

    <p><span class="arg">image</span>.stereo(<span class=
    "arg">offset_image</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Combines two images and produces a single
    image that is the composite of a left and right image of a
    stereo pair. Special red-green stereo glasses are required to
    view this effect.</p>

    <h4>Arguments</h4>

    <p>Another image or imagelist. If the argument is an imagelist,
    uses the current image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>StereoImage</p>
  </div>

  <div class="sig">
    <h3 id="store_pixels">store_pixels</h3>

    <p><span class="arg">image</span>.store_pixels(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">columns</span>, <span class="arg">rows</span>,
    <span class="arg">pixels</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Replace the pixels in the specified rectangle with the
    pixels in the <em>pixels</em> array.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The x- and y-offset of the rectangle to be replaced.</dd>

      <dt>columns, rows</dt>

      <dd>The number of rows and columns in the rectangle.</dd>

      <dt>pixels</dt>

      <dd>An array of <a href="struct.html#Pixel">pixels</a>. The
      number of pixels in the array must be the same as the number
      of pixels in the rectangle, that is,
      <code>rows*columns</code>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>The image, with the rectangle suitably altered.</p>

    <h4>Example</h4>

    <p><a href="javascript:popup('smile.rb.html')"><img src=
    "ex/smile.gif" title="Click to see the example script" alt=
    "smile example" /></a></p>

    <p>Also see the example for <a href=
    "image2.html#get_pixels"><code>get_pixels</code></a>.</p>

    <h4>See also</h4>

    <p><a href="image1.html#constitute">constitute</a>, <a href=
    "image2.html#get_pixels">get_pixels</a>, <a href=
    "#view">view</a></p>

    <h4>Magick API</h4>

    <p>SetImagePixels, SyncImagePixels</p>
  </div>

  <div class="sig">
    <h3 id="strip_bang">strip!</h3>

    <p><span class="arg">image</span>.strip! -&gt;
    <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Strips an image of all profiles and
    comments.</p>

    <h4>Returns</h4>

    <p>self</p>

    <h4>Magick API</h4>StripImage (available in ImageMagick and
    GraphicsMagick 1.1)
  </div>

  <div class="sig">
    <h3 id="swirl">swirl</h3>

    <p><span class="arg">image</span>.swirl(<span class=
    "arg">degrees</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Swirls the pixels about the center of the
    image, where degrees indicates the sweep of the arc through
    which each pixel is moved. You get a more dramatic effect as
    the degrees move from 1 to 360.</p>

    <h4>Arguments</h4>

    <p>The number of degrees to swirl the image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>This example is an animated image. Mouse over the image to
    start the animation.</p>

    <p class="rollover"><a href=
    "javascript:popup('swirl.rb.html')"><img onmouseover=
    "this.src='ex/swirl.gif'" onmouseout=
    "this.src='ex/images/Flower_Hat.jpg'" src=
    "ex/images/Flower_Hat.jpg" alt="swirl example" title=
    "Click the image to see the example script" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the animation" /></p>

    <h4>Magick API</h4>

    <p>SwirlImage</p>
  </div>

  <div class="sig">
    <h3 id="texture_fill_to_border">texture_fill_to_border</h3>

    <p><span class=
    "arg">image</span>.texture_fill_to_border(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">texture</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Replaces the target pixel at <span class="arg">x</span>,
    <span class="arg">y</span> and its neighbors that are not the
    border color with copies of the <span class=
    "arg">texture</span> image. Use the <a href=
    "imageattrs.html#Image.fuzz">fuzz</a> attribute to specify how
    closely a pixel must match the border color.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The x- and y-offset of the target pixel.</dd>

      <dt>texture</dt>

      <dd>An image or imagelist. If an imagelist, uses the current
      image.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>In this example the target is the pixel in the center of the
    image. The texture - in this case a picture of a girl in a
    flowered hat - replaces this pixel and its neighbors until
    reaching a black pixel. Mouse over the image to see the
    original image. Notice the plum-colored circles are replaced as
    well. Compare this result with the result of
    <code>texture_floodfill</code>, below.</p>

    <p class="rollover"><a href=
    "javascript:popup('texture_fill_to_border.rb.html')"><img src=
    "ex/texture_fill_to_border_after.gif" alt=
    "texture_fill_to_border example" onmouseover=
    "this.src='ex/texture_fill_to_border_before.gif'" onmouseout=
    "this.src='ex/texture_fill_to_border_after.gif'" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" style="left:206px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href=
    "image1.html#color_fill_to_border">color_fill_to_border</a>,
    <a href=
    "image2.html#matte_fill_to_border">matte_fill_to_border</a></p>

    <h4>Magick API</h4>

    <p>ColorFloodfillImage</p>
  </div>

  <div class="sig">
    <h3 id="texture_floodfill">texture_floodfill</h3>

    <p><span class=
    "arg">image</span>.texture_floodfill(<span class="arg">x</span>,
    <span class="arg">y</span>, <span class="arg">texture</span>)
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Replaces the target pixel at <span class="arg">x</span>,
    <span class="arg">y</span> and its neighbors that are the same
    color with the <span class="arg">texture</span> image. By
    default, the neighbor pixels must be exactly the same color as
    the target pixel. Use the <a href=
    "imageattrs.html#Image.fuzz">fuzz</a> attribute to specify how
    much difference is acceptable.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The x- and y-offset of the target pixel.</dd>

      <dt>texture</dt>

      <dd>An image or imagelist. If an imagelist, uses the current
      image.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>In this example the target is the pixel in the center of the
    image. The texture - in this case a picture of a girl in a
    flowered hat - replaces this pixel and its same-colored
    neighbors. Mouse over the image to see the original image.
    Notice the plum-colored circles are not replaced. Compare this
    result with the result of <code>texture_fill_to_border</code>,
    above.</p>

    <p class="rollover"><a href=
    "javascript:popup('texture_floodfill.rb.html')"><img src=
    "ex/texture_floodfill_after.gif" alt=
    "texture_floodfill example" onmouseover=
    "this.src='ex/texture_floodfill_before.gif'" onmouseout=
    "this.src='ex/texture_floodfill_after.gif'" title=
    "Click to see the example script" /></a><img src=
    "ex/images/spin.gif" alt="" class="spin" style="left:206px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image1.html#color_floodfill">color_floodfill</a>,
    <a href="image2.html#matte_floodfill">matte_floodfill</a></p>

    <h4>Magick API</h4>

    <p>ColorFloodfillImage</p>
  </div>

  <div class="sig">
    <h3 id="threshold">threshold</h3>

    <p><span class="arg">image</span>.threshold(<span class=
    "arg">threshold</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Changes the value of individual pixels based
    on the intensity of each pixel compared to <span class=
    "arg">threshold</span>. The result is a high-contrast, two
    color image.</p>

    <h4>Arguments</h4>

    <p>A value between 0 and MaxRGB.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p><code>threshold(Magick::MaxRGB*0.55)</code></p>

    <p class="rollover"><a href=
    "javascript:popup('threshold.rb.html')"><img src=
    "ex/threshold.jpg" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/threshold.jpg'" title=
    "Click to see the example script" alt=
    "threshold example" /></a><img src="ex/images/spin.gif" alt=""
    class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href=
    "image1.html#adaptive_threshold">adaptive_threshold</a>,
    <a href="image1.html#bilevel_channel">bilevel_channel</a>,
    <a href=
    "#random_threshold_channel">random_threshold_channel</a></p>

    <h4>Magick API</h4>

    <p>ThresholdImage</p>
  </div>

  <div class="sig">
    <h3 id="thumbnail">thumbnail</h3>

    <p><span class="arg">image</span>.thumbnail(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>anImage</em><br />
    <span class="arg">image</span>.thumbnail(<span class=
    "arg">scale_factor</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>The <code>thumbnail</code> method is a fast resizing method
    suitable for use when the size of the resulting image is &lt;
    10% of the original.</p>

    <h4>Arguments</h4>

    <p>You can call <code>thumbnail</code> with either the new
    width and height or the scale factor.</p>

    <dl>
      <dt>new_width, new_height</dt>

      <dd>The desired width and height in pixels.</dd>

      <dt>scale_factor</dt>

      <dd>The desired size represented as a floating-point number.
      For example, to make a thumbnail that is 9.5% of the size of
      the original image, use <code>0.095</code>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>
    <pre>
img = Magick::Image.read("images/Cheetah.jpg").first
thumbnail = img.thumbnail(img.columns*0.09, img.rows*0.09)
</pre>

    <h4>See also</h4>

    <p><a href="image2.html#minify">minify</a>, <a href=
    "#resize">resize</a>, <a href="#sample">sample</a>, <a href=
    "#scale">scale</a></p>

    <h4>Magick API</h4>

    <p>ThumbnailImage</p>
  </div>

  <div class="sig">
    <h3 id="thumbnail_bang">thumbnail!</h3>

    <p><span class="arg">image</span>.thumbnail!(<span class=
    "arg">new_width</span>, <span class="arg">new_height</span>)
    -&gt; <em>image</em><br />
    <span class="arg">image</span>.thumbnail!(<span class=
    "arg">scale_factor</span>) -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#thumbnail">thumbnail</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="to_blob">to_blob</h3>

    <p><span class="arg">image</span>.to_blob <span class="arg">[ {
    optional arguments } ]</span>-&gt; <em>aString</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates a <em>B</em>inary <em>L</em>arge <em>OB</em>ject, a
    direct-to-memory version of the image. The <a href=
    "image1.html#from_blob">from_blob</a> method constructs an
    image from a BLOB created by this method.</p>

    <h4>Arguments</h4>

    <p>No required arguments, however you can specify the image
    format (such as JPEG, PNG, etc.) and depth by calling the
    <a href="imageattrs.html#Image.format">format</a> and <a href=
    "imageattrs.html#Image.depth">depth</a> attributes, as well as
    other <a href="info.html">Image::Info</a> attributes as
    appropriate, in a block associated with the method.</p>

    <h4>Returns</h4>

    <p>A string containing the image data represented as a
    BLOB.</p>

    <h4>Example</h4>

    <p><a href="javascript:popup('to_blob.rb.html')"><img src=
    "ex/to_blob.gif" alt="to_blob example" title=
    "Click to see the example script" /></a></p>

    <h4>See also</h4>

    <p><a href="image1.html#Ifrom_blob">from_blob</a></p>

    <h4>Magick API</h4>

    <p>ImageToBlob</p>
  </div>

  <div class="sig">
    <h3 id="to_color">to_color</h3>

    <p><span class="arg">image</span>.to_color(<span class=
    "arg">aPixel</span>) -&gt; <em>aString</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Returns the color name for a pixel. Unlike the
    <code>Pixel#to_color</code> method, to_color uses the <a href=
    "imageattrs.html#Image.depth">depth</a> and <a href=
    "imageattrs.html#Image.matte">matte</a> attributes of the image
    to determine the color name.</p>

    <h4>Arguments</h4>

    <p>A <a href="struct.html#Pixel">Pixel</a> object.</p>

    <h4>Returns</h4>

    <p>A <a href="imusage.html#color_names">color name</a>.</p>

    <h4>Example</h4>
    <pre>
img = Image.read('ex/images/Flower_Hat.jpg').first
&raquo; ex/images/Flower_Hat.jpg JPEG 200x250 DirectClass 8-bit 9761b
pixel = img.pixel_color(img.columns/2, img.rows/2)
&raquo; #&lt;struct Magick::Pixel red=216, green=147, blue=106, opacity=0&gt;
img.to_color(pixel)
&raquo; "#D8936A"
</pre>

    <h4>See also</h4>

    <p><a href="struct.html#Pixel.to_color">Pixel#to_color</a></p>

    <h4>Magick API</h4>

    <p>QueryColorname</p>
  </div>

  <div class="sig">
    <h3 id="transparent">transparent</h3>

    <p><span class="arg">image</span>.transparent(<span class=
    "arg">color</span>, <span class=
    "arg">opacity</span>=Magick::TransparentOpacity) -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Changes the opacity value of all the pixels that match
    <span class="arg">color</span> to the value specified by
    <span class="arg">opacity</span>. By default the pixel must
    match exactly, but you can specify a tolerence level by setting
    the <a href="imageattrs.html#Image.fuzz">fuzz</a> attribute on
    the image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>color</dt>

      <dd>Either a <a href="imusage.html#color_names">color
      name</a> or a <a href="struct.html#Pixel">pixel</a>.</dd>

      <dt>opacity</dt>

      <dd>The new opacity value, either an <a href=
      "constants.html#Opacity">opacity</a> value or a number
      between 0 and MaxRGB. The default is TransparentOpacity.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>Mouse over the image to see the original. In this example,
    all the black pixels are made transparent. The resulting image
    has been composited over a plasma background, which shows
    through the transparent pixels.</p>

    <p class="rollover"><a href=
    "javascript:popup('transparent.rb.html')"><img src=
    "ex/transparent_after.gif" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/transparent_before.gif'" onmouseout=
    "this.src='ex/transparent_after.gif'" alt=
    "transparent example" /></a><img src="ex/images/spin.gif" alt=
    "" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image2.html#matte_replace">matte_replace</a>,
    <a href="draw.html#Draw.matte">Draw#matte</a></p>

    <h4>Magick API</h4>

    <p>TransparentImage</p>
  </div>

  <div class="sig">
    <h3 id="transpose">transpose</h3>

    <p><span class="arg">image</span>.transpose -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Creates a horizontal mirror image by
    reflecting the pixels around the central y-axis while rotating
    them by 90 degrees.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('transpose.rb.html')"><img src=
    "ex/transpose.jpg" alt="transpose example" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/transpose.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" style="left:252px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image2.html#flip">flip</a>, <a href=
    "image2.html#flop">flop</a>, <a href=
    "image3.html#rotate">rotate</a>, <a href=
    "#transpose_bang">transpose!</a>, <a href=
    "image3.html#transverse">transverse</a></p>

    <h4>Magick API</h4>

    <p>TransposeImage (available in ImageMagick 6.2.8)</p>
  </div>

  <div class="sig">
    <h3 id="transpose_bang">transpose!</h3>

    <p><span class="arg">image</span>.transpose! -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#transpose">transpose</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="transverse">transverse</h3>

    <p><span class="arg">image</span>.transverse -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Creates a vertical mirror image by
    reflecting the pixels around the central x-axis while rotating
    them by 270 degrees</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('transverse.rb.html')"><img src=
    "ex/transverse.jpg" alt="transverse example" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/transverse.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" style="left:252px;"
    title="Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image2.html#flip">flip</a>, <a href=
    "image2.html#flop">flop</a>, <a href=
    "image3.html#rotate">rotate</a>, <a href=
    "image3.html#transpose">transpose</a>, <a href=
    "#transverse_bang">transverse!</a></p>

    <h4>Magick API</h4>

    <p>TransposeImage (available in ImageMagick 6.2.8)</p>
  </div>

  <div class="sig">
    <h3 id="transverse_bang">transverse!</h3>

    <p><span class="arg">image</span>.transverse! -&gt;
    <em>self</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>In-place form of <a href="#transverse">transverse</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="trim">trim</h3>

    <p><span class="arg">image</span>.trim -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Removes the edges that are exactly the same
    color as the corner pixels. Use the <a href=
    "imageattrs.html#fuzz">fuzz</a> attribute to make
    <code>trim</code> remove edges that are nearly the same color
    as the corner pixels.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('trim.rb.html')"><img src="ex/trim_after.jpg"
    onmouseover="this.src='ex/trim_before.jpg'" onmouseout=
    "this.src='ex/trim_after.jpg'" alt="trim example" title=
    "Click to see the example script" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the image to see the original image" /></p>

    <h4>Magick API</h4>

    <p>CropImage</p>
  </div>

  <div class="sig">
    <h3 id="trim_bang">trim!</h3>

    <p><span class="arg">image</span>.trim! -&gt; <em>self</em></p>
  </div>

  <div class="desc">
    <p>In-place form of <a href="#trim">trim</a>.</p>

    <h4>Returns</h4>

    <p>self</p>
  </div>

  <div class="sig">
    <h3 id="unique_colors">unique_colors</h3>

    <p><span class="arg">image</span>.unique_colors -&gt;
    <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Constructs a new image with one pixel for each unique color
    in the image. The new image has 1 row. The row has 1 column for
    each unique pixel in the image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Magick API</h4>

    <p>UniqueImageColors (available in ImageMagick 6.2.9)</p>
  </div>

  <div class="sig">
    <h3 id="unsharp_mask">unsharp_mask</h3>

    <p><span class="arg">image</span>.unsharp_mask(<span class=
    "arg">radius=0.0</span>, <span class="arg">sigma=1.0</span>,
    <span class="arg">amount=1.0</span>, <span class=
    "arg">threshold=0.05</span>) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Sharpens an image. We convolve the image
    with a Gaussian operator of the given <span class=
    "arg">radius</span> and standard deviation (<span class=
    "arg">sigma</span>). For reasonable results, <span class=
    "arg">radius</span> should be larger than <span class=
    "arg">sigma</span>. Use a radius of 0 and
    <code>unsharp_mask</code> selects a suitable radius for
    you.</p>

    <h4>Arguments</h4>

    <p>All arguments are optional.</p>

    <dl>
      <dt>radius</dt>

      <dd>The radius of the Gaussian operator. The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd>The standard deviation of the Gaussian operator. A good
      starting value is 1.0, which is the default.</dd>

      <dt>amount</dt>

      <dd>The percentage of the blurred image to be added to the
      receiver, specified as a fraction between 0 and 1.0. A good
      starting value is 1.0, which is the default.</dd>

      <dt>threshold</dt>

      <dd>The threshold needed to apply the amount, specified as a
      fraction between 0 and 1.0. A good starting value is 0.05,
      which is the default.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p><a href=
    "javascript:popup:('unsharp_mask.rb.html')"><img src="ex/unsharp_mask.jpg"
    alt="unsharp_mask example" title=
    "Click to see the example script" /></a></p>

    <h4>See also</h4>

    <p><a href="image1.html#enhance">enhance</a>, <a href=
    "image2.html#median_filter">median_filter</a>, <a href=
    "image3.html#reduce_noise">reduce_noise</a>, <a href=
    "#unsharp_mask_channel">unsharp_mask_channel</a></p>

    <h4>Magick API</h4>

    <p>UnsharpMaskImage</p>
  </div>

  <div class="sig">
    <h3 id="unsharp_mask_channel">unsharp_mask_channel</h3>

    <p><span class=
    "arg">image</span>.unsharp_mask_channel(<span class=
    "arg">radius=0.0</span>, <span class="arg">sigma=1.0</span>,
    <span class="arg">amount=1.0</span>, <span class=
    "arg">threshold=0.05</span> [,<span class=
    "arg">channel</span>...]) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Sharpens an image. We convolve the image
    with a Gaussian operator of the given <span class=
    "arg">radius</span> and standard deviation (<span class=
    "arg">sigma</span>). For reasonable results, <span class=
    "arg">radius</span> should be larger than <span class=
    "arg">sigma</span>. Use a radius of 0 and
    <code>unsharp_mask_channel</code> selects a suitable radius for
    you.</p>

    <p>Only the specified channels are sharpened.</p>

    <h4>Arguments</h4>

    <p>All arguments are optional.</p>

    <dl>
      <dt>radius</dt>

      <dd>The radius of the Gaussian operator. The default is
      0.0.</dd>

      <dt>sigma</dt>

      <dd>The standard deviation of the Gaussian operator. A good
      starting value is 1.0, which is the default.</dd>

      <dt>amount</dt>

      <dd>The percentage of the blurred image to be added to the
      receiver, specified as a fraction between 0 and 1.0. A good
      starting value is 1.0, which is the default.</dd>

      <dt>threshold</dt>

      <dd>The threshold needed to apply the amount, specified as a
      fraction between 0 and 1.0. A good starting value is 0.05,
      which is the default.</dd>

      <dt>channel...</dt>

      <dd>0 or more <a href=
      "constants.html#ChannelType">ChannelType</a> arguments. If no
      channels are specified, all the channels are sharpened. This
      is the equivalent of <a href=
      "#unsharp_mask">unsharp_mask</a>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image1.html#enhance">enhance</a>, <a href=
    "image2.html#median_filter">median_filter</a>, <a href=
    "image3.html#reduce_noise">reduce_noise</a>, <a href=
    "#unsharp_mask">unsharp_mask</a></p>

    <h4>Magick API</h4>

    <p>UnsharpMaskImageChannel (available in ImageMagick 6.1.0)</p>
  </div>

  <div class="sig">
    <h3 id="view">view</h3>

    <p><span class="arg">image</span>.view(<span class=
    "arg">x</span>, <span class="arg">y</span>, <span class=
    "arg">width</span>, <span class="arg">height</span>) -&gt;
    <em>aView</em><br />
    <span class="arg">image</span>.view(<span class="arg">x</span>,
    <span class="arg">y</span>, <span class="arg">width</span>,
    <span class="arg">height</span>) {&nbsp;|view|
    <em>block</em>&nbsp;} -&gt; <em>nil</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4><code>View</code> is a convenience method
    that supports getting and setting individual image pixels by
    <code>[i][j]</code> coordinates. With no associated block,
    <code>view</code> returns an <a href=
    "struct.html#view">Image::View</a> object. If the optional code
    block is given, it will be passed the <code>Image::View</code>
    object as an argument. The <a href=
    "struct.html#view_sync">sync</a> method will be called
    automatically when the block terminates. In this case,
    <code>view</code> returns <code>nil</code>.

    <h4>Arguments</h4>

    <dl>
      <dt>x, y</dt>

      <dd>The offset of the view from the top-left corner of the
      image. Within the view, pixels are relative to the top-left
      corner of the view, <em>not</em> the image.</dd>

      <dt>width, height</dt>

      <dd>The width and height of the view. The view may not extend
      past the boundaries of <span class="arg">image</span>.</dd>
    </dl>

    <h4>Returns</h4>

    <p>If the optional code block is present, <code>view</code>
    returns <code>nil</code>. If it is not present,
    <code>view</code> returns an <code>Image::View</code>
    object.</p>

    <h4>See</h4>

    <p><a href="struct.html#view">Image::View</a></p>

    <h4>Examples</h4>

    <p>The example image below has been scaled 500% for
    clarity.</p>

    <p><a href="javascript:popup('viewex.rb.html')"><img src=
    "ex/viewex.gif" title="Click to see the example script" alt=
    "view example" /></a></p>
    <pre>
img = Image.new(40, 40) {self.background_color = 'lightcyan2'}

# The view is 400 pixels square, starting at
# column 10, row 5 from the top of the image.
img.view( 10, 5, 20, 20) do |view|

    # Set all the pixels in the view to green.
    view[][] = Pixel.new(0, MaxRGB)

    # Change the top and bottom rows to red.
    view[0][] = 'red'
    view[-1,1][] = 'red'

    # Set 6 pixels to black.
    view[[13,15]][[12,14,16]] = 'black'

    # Set 1 pixel to yellow.
    view[5][7] = 'yellow'

    # Change the green channel of all the
    # pixels on row 8.
    view[8][].green = MaxRGB/2

    # Change the blue channel of 8 pixels
    # on column 10.
    view[4,8][10].blue = MaxRGB
end
</pre>

    <h4>See also</h4>

    <p><a href="image2.html#pixel_color">pixel_color</a>, <a href=
    "image2.html#get_pixels">get_pixels</a>, <a href=
    "#store_pixels">store_pixels</a></p>

    <h4>Notes</h4>

    <p>The <code>view</code> method introduces a relatively high
    level of overhead to pixel manipulation compared to methods
    that use the &times;Magick API to identify and change pixels. I
    recommend that you use <code>view</code> only when the number
    of pixels identified in the view is fairly small (a few
    thousand to a few hundred thousand, depending on your patience
    and the speed of your computer) and you need this degree of
    control.</p>
  </div>

  <div class="sig">
    <h3 id="vignette">vignette</h3>

    <p>image.vignette(<span class="arg">x</span>, <span class=
    "arg">y</span>, <span class="arg">radius</span>=0.0,
    <span class="arg">sigma</span>=10.0) -&gt; <span class=
    "arg">anImage</span></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Gradually shades the edges of the image by transforming the
    pixels into the background color.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>x</dt>

      <dd>Influences the amount of background color in the
      horizontal dimension. Larger values of <span class=
      "arg">x</span> make the vignette narrower. This argument
      should be positive and less than image.columns / 2. This
      argument is optional. If omitted, the default value is 0.10 *
      <span class="arg">image</span>.columns.</dd>

      <dt>y</dt>

      <dd>Influences the amount of background color in the vertical
      dimension. Larger values of <span class="arg">y</span> make
      the vignette shorter. This argument should be positive and
      less than image.rows / 2. This argument is optional. If
      omitted, the default value is 0.10 * <span class=
      "arg">image</span>.rows.</dd>

      <dt>radius, sigma</dt>

      <dd>Controls the amount of blurring. Larger values of
      <span class="arg">sigma</span> increase the blurring at the
      expense of increased execution time. In general, <span class=
      "arg">radius</span> should be larger than <span class=
      "arg">sigma</span>, although if <span class=
      "arg">radius</span> is 0 then &times;Magick will choose a
      suitable value. <span class="arg">Sigma</span> must be
      non-zero. Choose a very small value for <span class=
      "arg">sigma</span> to produce a "hard" edge.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href=
    "javascript:popup('vignette.rb.html')"><img src=
    "ex/vignette.jpg" alt="vignette example" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/vignette.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>VignetteImage (available in ImageMagick 6.2.6)</p>

    <h4>Notes</h4>

    <p>The image produced by <code>vignette</code> is very similar
    to the image produced by RMagick's vignette.rb example script.
    However, the example script gives you more control over the
    size, shape, and background color of the vignette.</p>
  </div>

  <div class="sig">
    <h3 id="watermark">watermark</h3>

    <p><span class="arg">image</span>.watermark(<span class=
    "arg">mark</span>, <span class="arg">lightness</span>=1.0,
    <span class="arg">saturation</span>=1.0, <span class=
    "arg">x_offset</span>=0, <span class="arg">y_offset</span>=0)
    -&gt; <em>anImage</em><br />
    <span class="arg">image</span>.watermark(<span class=
    "arg">mark</span>, <span class="arg">lightness</span>=1.0,
    <span class="arg">saturation</span>=1.0, <span class=
    "arg">gravity</span>, <span class="arg">x_offset</span>=0,
    <span class="arg">y_offset</span>=0) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Composites a watermark image on the target image using the
    <a href="constants.html#CompositeOperator">Modulate</a>
    composite operator. This composite operation operates in the
    HSL colorspace and combines part of the lightness, part of the
    saturation, and all of the hue of each pixel in the watermark
    with the corresponding pixel in the target image</p>

    <h4>Arguments</h4>

    <dl>
      <dt>mark</dt>

      <dd>The watermark image. Either an imagelist or an image. If
      an imagelist, uses the current image.</dd>

      <dt>lightness</dt>

      <dd>The fraction of the lightness component of the watermark
      pixels to be composited onto the target image. Must be a
      non-negative number or a string in the form "NN%". If
      lightness is a number it is interpreted as a percentage. Both
      0.25 and "25%" mean 25%. The default is 100%.</dd>

      <dt>saturation</dt>

      <dd>The fraction of the saturation component of the watermark
      pixels to be composited onto the target image. Must be a
      non-negative number or a string in the form "NN%". If
      lightness is a number it is interpreted as a percentage. Both
      0.25 and "25%" mean 25%. The default is 100%.</dd>

      <dt>x_offset</dt>

      <dd>The offset of the watermark, measured from the left-hand
      side of the target image. The default is 0.</dd>

      <dt>y_offset</dt>

      <dd>The offset of the watermark, measured from the top of the
      target image. The default is 0.</dd>
    </dl>

    <p>Watermark can be called with a <span class=
    "arg">gravity</span> argument or without. When a <span class=
    "arg">gravity</span> argument is specified but the <span class=
    "arg">x-</span> and <span class="arg">y-offsets</span> are
    omitted, the watermark is positioned based on the value of the
    <span class="arg">gravity</span> argument:</p>

    <dl>
      <dt>NorthWestGravity</dt>

      <dd>The watermark abuts the top and left sides of the
      image.</dd>

      <dt>NorthGravity</dt>

      <dd>The watermark is centered left-to-right and abuts the top
      of the image.</dd>

      <dt>NorthEastGravity</dt>

      <dd>The watermark abuts the top and right sides of the
      image.</dd>

      <dt>EastGravity</dt>

      <dd>The watermark is centered top-to-bottom and abuts the
      right side of the image.</dd>

      <dt>SouthEastGravity</dt>

      <dd>The watermark abuts the bottom and right sides of the
      image.</dd>

      <dt>SouthGravity</dt>

      <dd>The watermark is centered left-to-right and abuts the
      bottom of the image.</dd>

      <dt>SouthWestGravity</dt>

      <dd>The watermark abuts the bottom and left sides of the
      image.</dd>

      <dt>WestGravity</dt>

      <dd>The watermark is centered top-to-bottom and abuts the
      left side of the image.</dd>

      <dt>CenterGravity</dt>

      <dd>The watermark is centered left-to-right and
      top-to-bottom.</dd>
    </dl>

    <p>When the <span class="arg">gravity</span> argument is
    present and the <span class="arg">x-offset</span> (and
    optionally the <span class="arg">y-offset</span>) is present,
    the <span class="arg">x-</span> and <span class=
    "arg">y-offset</span> are measured from the right and/or bottom
    edges of the target image based on the value of <span class=
    "arg">gravity</span>. If the argument is NorthEastGravity,
    EastGravity, or SouthEastGravity, the <span class=
    "arg">x-offset</span> is measured from the right side of the
    image. If the argument is SouthEastGravity, SouthGravity, or
    SouthWestGravity, the <span class="arg">y-offset</span> is
    measured from the bottom of the image. All other values are
    ignored and the <span class="arg">x-</span> and <span class=
    "arg">y-offset</span> are measured from the upper-left corner
    of the image.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>See <a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/annotating/#wmark_image">
    "Watermarking with Images"</a> in Anthony Thyssen's <a href=
    "http://www.cit.gu.edu.au/~anthony/graphics/imagick6/"><cite>Examples
    of ImageMagick Usage</cite></a>.</p>

    <p class="rollover"><a href=
    "javascript:popup('watermark.rb.html')"><img src=
    "ex/watermark.jpg" alt="watermark example" title=
    "Click to see the example script" onmouseover=
    "this.src='ex/images/Flower_Hat.jpg'" onmouseout=
    "this.src='ex/watermark.jpg'" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>See also</h4>

    <p><a href="image1.html#composite">composite</a>, <a href=
    "#stegano">stegano</a></p>
  </div>

  <div class="sig">
    <h3 id="wave">wave</h3>

    <p><span class="arg">image</span>.wave(<span class=
    "arg">amplitude</span>=25.0, <span class=
    "arg">wavelength</span>=150.0) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Creates a "ripple" effect in the image by
    shifting the pixels vertically along a sine wave whose
    <span class="arg">amplitude</span> and <span class=
    "arg">wavelength</span> is specified by the given
    parameters.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p class="rollover"><a href="javascript:popup('wave.rb.html')">
    <!-- This img tag displays the original image when the mouse is over -->
     <img style=
    "padding-top:25px; padding-bottom:25px; display:none" id=
    "nowave" title="Click to see the example script" onmouseout=
    "this.style.display='none'; waved.style.display='';" src=
    "ex/images/Flower_Hat.jpg" alt="wave example"  />
    <!--
                                                              This img tag displays the framed image when the mouse is not over
                                                              --><img class="hide"
    id="waved" onmouseover=
    "this.style.display='none'; nowave.style.display='';" src=
    "ex/wave.jpg" alt="wave example" /></a> <img src=
    "ex/images/spin.gif" alt="" class="spin" title=
    "Mouse over the example to see the original image" /></p>

    <h4>Magick API</h4>

    <p>WaveImage</p>

    <h4>See also</h4>

    <p><a href=
    "imageattrs.html#virtual_pixel_method">virtual_pixel_method</a></p>
  </div>

  <div class="sig">
    <h3 id="wet_floor">wet_floor</h3>

    <p><span class="arg">image</span>.wet_floor(<span class=
    "arg">intial=0.5</span>, <span class="arg">rate=1.0</span>)
    -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Creates a <a href=
    "http://en.wikipedia.org/wiki/Wet_floor_effect">"wet floor"</a>
    reflection. The reflection is an inverted copy of the image
    that changes from partially transparent to entirely
    transparent. By default only the bottom third of the image
    appears in the reflection.</p>

    <p>Note that the output image is just the reflection. This
    makes it easy to apply further transformations to the
    reflection before combining it with the original image.</p>

    <h4>Arguments</h4>

    <dl>
      <dt>initial</dt>

      <dd>A value between 0.0 and 1.0 that specifies the initial
      percentage of transparency. Higher values cause the top of
      the reflection to be more transparent, lower values less
      transparent. The default is 0.5, which means that the top of
      the reflection is 50% transparent.</dd>

      <dt>rate</dt>

      <dd>A non-negative value that specifies how rapidly the
      reflection transitions from the initial level of transparency
      to entirely transparent. The default value is 1.0, which
      means that the transition occurs in 1/3 the image height.
      Values greater than 1.0 speed up the transition (the
      reflection will have fewer rows), values lower than 1.0 slow
      down the transition (the reflection will have more rows). A
      value of 0.0 means that the level of transparency will not
      change.</dd>
    </dl>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>Example</h4>

    <p>Here are four examples of <code>wet_floor</code>. The top
    image shows the result of appending the default reflection to
    the original image. The second image shows the result of
    decreasing the initial transparency to 0.25 and using 0.5 as
    the <span class="arg">rate</span> argument. The third image
    uses the same reflection as the second image but has a slant
    added. The bottom image is the same as the third image but with
    a ripple effect.</p>

    <p><a href="javascript:popup('wet_floor.rb.html')"><img src=
    "ex/wet_floor.gif" title="Click to see the example script" alt=
    "wet floor example" /></a></p>
  </div>

  <div class="sig">
    <h3 id="white_threshold">white_threshold</h3>

    <p><span class="arg">image</span>.white_threshold(<span class=
    "arg">red_channel</span> [, <span class=
    "arg">green_channel</span>[, <span class=
    "arg">blue_channel</span>[, <span class=
    "arg">opacity_channel</span>]]]) -&gt; <em>anImage</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p class="imquote">Forces all pixels above the threshold into
    white while leaving all pixels below the threshold
    unchanged.</p>

    <h4>Arguments</h4>

    <p>Each channel argument is a number between 0 and MaxRGB. All
    arguments except the first may be omitted. If the <span class=
    "arg">green_channel</span> or <span class=
    "arg">blue_channel</span> argument is omitted, the default
    value is the <span class="arg">red_channel</span> value. If the
    <span class="arg">opacity_channel</span> argument is omitted,
    the default value is <a href=
    "constants.html#Opacity">OpaqueOpacity</a>.</p>

    <h4>Returns</h4>

    <p>A new image</p>

    <h4>See also</h4>

    <p><a href="image1.html#black_threshold">black_threshold</a>,
    <a href="image1.html#bilevel_channel">bilevel_channel</a></p>

    <h4>Magick API</h4>

    <p>WhiteThresholdImage</p>
  </div>

  <div class="sig">
    <h3 id="write">write</h3>

    <p><span class="arg">image</span>.write(<span class=
    "arg">filename</span>) <span class="arg">[ { optional arguments
    } ]</span> -&gt; <span class="arg">image</span><br />
    <span class="arg">image</span>.write(<span class=
    "arg">file</span>) <span class="arg">[ { optional arguments }
    ]</span> -&gt; <em>image</em></p>
  </div>

  <div class="desc">
    <h4>Description</h4>

    <p>Writes the image to the specified file. &times;Magick
    determines image format from the <a href=
    "imusage.html#formats">prefix or extension</a>.</p>

    <p>If the argument is an open file, &times;Magick will write
    the image in its current format. You can force a different
    format by setting the image's <a href=
    "imageattrs.html#Image.format">format</a> attribute.</p>

    <h4>Arguments</h4>

    <p>A file name or open file object. You may also specify
    optional arguments by setting <a href=
    "info.html">Image::Info</a> attributes in an associated
    block.</p>

    <h4>Returns</h4>

    <p><code>self</code>, or <code>nil</code> if the image format
    cannot be determined.</p>

    <h4>Example</h4>

    <p>Almost all of the examples call <code>write</code>.</p>

    <h4>See also</h4>

    <p><a href="ilist.html#ImageList.write">ImageList#write</a></p>

    <h4>Magick API</h4>

    <p>WriteImage</p>
  </div>

  <p class="spacer">&nbsp;</p>

  <div class="nav">
    &laquo;&nbsp;<a href="image2.html">Prev</a> | <a href=
    "index.html">Contents</a> | <a href=
    "draw.html">Next</a>&nbsp;&raquo;
  </div>
</body>
</html>