Sophie

Sophie

distrib > Mandriva > mes5 > x86_64 > by-pkgid > 0d81a008159b90d5a3553d84969a208b > files > 104

graphicsmagick-doc-1.2.5-2.3mdvmes5.2.x86_64.rpm

<?xml version="1.0" ?>
<!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>
<title>quantize - Reduce the number of colors in an image</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:bfriesen@freddy.simplesystems.org" />
</head>

<body style="background-color: white">

<P><a name="__index__"></a></P>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#function_descriptions">FUNCTION DESCRIPTIONS</a></li>
	<ul>

		<li><a href="#clonequantizeinfo">CloneQuantizeInfo</a></li>
		<li><a href="#compressimagecolormap">CompressImageColormap</a></li>
		<li><a href="#destroyquantizeinfo">DestroyQuantizeInfo</a></li>
		<li><a href="#getimagequantizeerror">GetImageQuantizeError</a></li>
		<li><a href="#getquantizeinfo">GetQuantizeInfo</a></li>
		<li><a href="#grayscalepseudoclassimage">GrayscalePseudoClassImage</a></li>
		<li><a href="#mapimage">MapImage</a></li>
		<li><a href="#mapimages">MapImages</a></li>
		<li><a href="#orderedditherimage">OrderedDitherImage</a></li>
		<li><a href="#quantizeimage">QuantizeImage</a></li>
		<li><a href="#quantizeimages">QuantizeImages</a></li>
	</ul>

</ul>
<!-- INDEX END -->

<hr />
<P>
</P>
<h1><a name="name">NAME</a></h1>
<P>quantize - Reduce the number of colors in an image</P>
<P>
</P>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<P>QuantizeInfo * <strong>CloneQuantizeInfo</strong>( const QuantizeInfo *quantize_info );</P>
<P>void  <strong>CompressImageColormap</strong>( Image *image );</P>
<P><strong>DestroyQuantizeInfo</strong>( QuantizeInfo *quantize_info );</P>
<P>unsigned int  <strong>GetImageQuantizeError</strong>( Image *image );</P>
<P><strong>GetQuantizeInfo</strong>( QuantizeInfo *quantize_info );</P>
<P>void  <strong>GrayscalePseudoClassImage</strong>( Image *image );</P>
<P>unsigned int  <strong>MapImage</strong>( Image *image, const Image *map_image, const unsigned int dither );</P>
<P>unsigned int  <strong>MapImages</strong>( Image *images, Image *map_image, const unsigned int dither );</P>
<P>unsigned int  <strong>OrderedDitherImage</strong>( Image *image );</P>
<P>unsigned int  <strong>QuantizeImage</strong>( const QuantizeInfo *quantize_info, Image *image );</P>
<P>unsigned int  <strong>QuantizeImages</strong>( const QuantizeInfo *quantize_info, Image *images );</P>
<P>
</P>
<hr />
<h1><a name="function_descriptions">FUNCTION DESCRIPTIONS</a></h1>
<P>
</P>
<h2><a name="clonequantizeinfo">CloneQuantizeInfo</a></h2>
<blockquote>CloneQuantizeInfo() makes a duplicate of the given quantize info structure, or if quantize info is NULL, a new one. </blockquote><P>The format of the CloneQuantizeInfo method is:</P>
<blockquote><A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *CloneQuantizeInfo ( const <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *quantize_info ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong><a name="item_o_clone_info_3a">clone_info:</a></strong>

<DD>
<P>Method CloneQuantizeInfo returns a duplicate of the given quantize info, or if image info is NULL a new one.</P>
</dd>
</li>
<dt><strong><a name="item_o_quantize_info_3a">quantize_info:</a></strong>

<DD>
<P>a structure of type info.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="compressimagecolormap">CompressImageColormap</a></h2>
<blockquote>CompressImageColormap() compresses an image colormap by removing any duplicate or unused color entries. </blockquote><P>The format of the CompressImageColormap method is:</P>
<blockquote>void CompressImageColormap ( <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong><a name="item_o_image_3a">image:</a></strong>

<DD>
<P>The image.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="destroyquantizeinfo">DestroyQuantizeInfo</a></h2>
<blockquote>DestroyQuantizeInfo() deallocates memory associated with an <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> structure. </blockquote><P>The format of the DestroyQuantizeInfo method is:</P>
<blockquote>DestroyQuantizeInfo ( <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *quantize_info ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>quantize_info:</strong>

<DD>
<P>Specifies a pointer to an QuantizeInfo structure.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="getimagequantizeerror">GetImageQuantizeError</a></h2>
<blockquote>GetImageQuantizeError() measures the difference between the original and quantized images. This difference is the total quantization error. The error is computed by summing over all pixels in an image the distance squared in RGB space between each reference pixel value and its quantized value. These values are computed: </blockquote><dl>
<dt><strong><a name="item_o_mean_error_per_pixel_3a">mean_error_per_pixel:</a></strong>

<DD>
<P>This value is the mean error for any single pixel in the image.</P>
</dd>
</li>
<dt><strong><a name="item_o_normalized_mean_square_error_3a">normalized_mean_square_error:</a></strong>

<DD>
<P>This value is the normalized mean quantization error for any single pixel in the image.  This distance measure is normalized to a range between 0 and 1.  It is independent of the range of red, green, and blue values in the image.</P>
</dd>
</li>
<dt><strong><a name="item_o_normalized_maximum_square_error_3a">normalized_maximum_square_error:</a></strong>

<DD>
<P>Thsi value is the normalized maximum quantization error for any single pixel in the image.  This distance measure is normalized to a range between 0 and 1.  It is independent of the range of red, green, and blue values in your image.</P>
</dd>
</li>
</dl>
<P>The format of the GetImageQuantizeError method is:</P>
<blockquote>unsigned int GetImageQuantizeError ( <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows.</P>
<dl>
<dt><strong>image:</strong>

<DD>
<P>Specifies a pointer to an Image structure; returned from ReadImage.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="getquantizeinfo">GetQuantizeInfo</a></h2>
<blockquote>GetQuantizeInfo() initializes the <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> structure. </blockquote><P>The format of the GetQuantizeInfo method is:</P>
<blockquote>GetQuantizeInfo ( <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *quantize_info ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>quantize_info:</strong>

<DD>
<P>Specifies a pointer to a QuantizeInfo structure.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="grayscalepseudoclassimage">GrayscalePseudoClassImage</a></h2>
<P>GrayscalePseudoClassImage converts an image to a PseudoClass grayscale representation with an (optionally) compressed and sorted colormap.  Colormap is ordered by increasing intensity.</P>
<P>The format of the GrayscalePseudoClassImage method is:</P>
<blockquote>void GrayscalePseudoClassImage ( <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong>

<DD>
<P>The image.</P>
</dd>
</li>
<dt><strong><a name="item_o_optimize_colormap_3a">optimize_colormap:</a></strong>

<DD>
<P>If true, produce an optimimal (compact) colormap.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="mapimage">MapImage</a></h2>
<blockquote>MapImage() replaces the colors of an image with the closest color from a reference image. </blockquote><P>The format of the MapImage method is:</P>
<blockquote>unsigned int MapImage ( <A HREF="types.html#Image">Image</A> *image, const <A HREF="types.html#Image">Image</A> *map_image, const unsigned int dither ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong>

<DD>
<P>Specifies a pointer to an Image structure.</P>
</dd>
</li>
<dt><strong><a name="item_o_map_image_3a">map_image:</a></strong>

<DD>
<P>Specifies a pointer to an Image structure.  Reduce image to a set of colors represented by this image.</P>
</dd>
</li>
<dt><strong><a name="item_o_dither_3a">dither:</a></strong>

<DD>
<P>Set this integer value to something other than zero to dither the quantized image.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="mapimages">MapImages</a></h2>
<blockquote>MapImages() replaces the colors of a sequence of images with the closest color from a reference image. If the reference image does not contain a colormap, then a colormap will be created based on existing colors in the reference image. The order and number of colormap entries does not match the reference image. If the order and number of colormap entries needs to match the reference image, then the ReplaceImageColormap ( ) function may be used after invoking MapImages ( ) in order to apply the reference colormap. </blockquote><P>The format of the MapImage method is:</P>
<blockquote>unsigned int MapImages ( <A HREF="types.html#Image">Image</A> *images, <A HREF="types.html#Image">Image</A> *map_image, const unsigned int dither ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>image:</strong>

<DD>
<P>Specifies a pointer to a set of Image structures.</P>
</dd>
</li>
<dt><strong>map_image:</strong>

<DD>
<P>Specifies a pointer to an Image structure.  Reduce image to a set of colors represented by this image.</P>
</dd>
</li>
<dt><strong>dither:</strong>

<DD>
<P>Set this integer value to something other than zero to dither the quantized image.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="orderedditherimage">OrderedDitherImage</a></h2>
<blockquote>OrderedDitherImage() uses the ordered dithering technique of reducing color images to monochrome using positional information to retain as much information as possible. </blockquote><P>The format of the OrderedDitherImage method is:</P>
<blockquote>unsigned int OrderedDitherImage ( <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows.</P>
<dl>
<dt><strong>image:</strong>

<DD>
<P>Specifies a pointer to an Image structure; returned from ReadImage.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="quantizeimage">QuantizeImage</a></h2>
<blockquote>QuantizeImage() 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 color difference between the input and output image while minimizing the processing time. </blockquote><P>The format of the QuantizeImage method is:</P>
<blockquote>unsigned int QuantizeImage ( const <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *quantize_info, <A HREF="types.html#Image">Image</A> *image ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>quantize_info:</strong>

<DD>
<P>Specifies a pointer to an QuantizeInfo structure.</P>
</dd>
</li>
<dt><strong>image:</strong>

<DD>
<P>Specifies a pointer to an Image structure.</P>
</dd>
</li>
</dl>
<P>
</P>
<h2><a name="quantizeimages">QuantizeImages</a></h2>
<blockquote>QuantizeImages() analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set. The goal of the algorithm is to minimize the color difference between the input and output images while minimizing the processing time. </blockquote><P>The format of the QuantizeImages method is:</P>
<blockquote>unsigned int QuantizeImages ( const <A HREF="types.html#QuantizeInfo">QuantizeInfo</A> *quantize_info, <A HREF="types.html#Image">Image</A> *images ); </blockquote><P>A description of each parameter follows:</P>
<dl>
<dt><strong>quantize_info:</strong>

<DD>
<P>Specifies a pointer to an QuantizeInfo structure.</P>
</dd>
</li>
<dt><strong><a name="item_o_images_3a">images:</a></strong>

<DD>
<P>Specifies a pointer to a list of Image structures.</P>
</dd>
</dl>

</body>

</html>