]> granicus.if.org Git - imagemagick/blobdiff - www/api/quantize.html
Clone the image->image_info structure to prevent a dangling pointer
[imagemagick] / www / api / quantize.html
index f7ed2db5e6dc9d8ff35f7db15fa3b6138fff4380..4aee30a573559ad05ea8aef672c64cff12acb8c9 100644 (file)
@@ -1,13 +1,9 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<!DOCTYPE html>
 <html lang="en">
 <head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge">
-  <meta name="viewport" content="width=device-width, initial-scale=1">
-  <title>ImageMagick: MagickCore, C API for ImageMagick: Reduce the Number of Unique Colors in an Image</title>
-  <meta http-equiv="content-language" content="en-US">
+  
+    <title>ImageMagick: MagickCore, C API for ImageMagick: Reduce the Number of Unique Colors in an Image</title>
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
-  <meta http-equiv="reply-to" content="magick-users@imagemagick.org">
   <meta name="application-name" content="ImageMagick">
   <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
   <meta name="application-url" content="http://www.imagemagick.org">
   <meta name="author" content="ImageMagick Studio LLC">
   <meta name="revisit-after" content="2 DAYS">
   <meta name="resource-type" content="document">
-  <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC">
+  <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
   <meta name="distribution" content="Global">
   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
-  <link rel="icon" href="../../images/wand.png">
-  <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon">
-  <link rel="stylesheet" href="../../css/bootstrap.min.css">
-  <link rel="stylesheet" href="../../css/magick.css">
+  <link rel="icon" href="../images/wand.png">
+  <link rel="shortcut icon" href="../images/wand.ico">
+  <link rel="stylesheet" href="../css/magick.html">
 </head>
-
 <body>
 <div class="main">
 <div class="magick-masthead">
   <div class="container">
-    <script type="text/javascript">
-    <!--
-      google_ad_client = "pub-3129977114552745";
-      google_ad_slot = "5439289906";
-      google_ad_width = 728;
-      google_ad_height = 90;
-    //-->
+    <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
+    <script>
+    (adsbygoogle = window.adsbygoogle || []).push({});
     </script>
-    <center><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
-    </script></center>
     <nav class="magick-nav">
-      <a class="magick-nav-item " href="../../index.html">Home</a>
-      <a class="magick-nav-item " href="../../www/binary-releases.html">Downloads</a>
-      <a class="magick-nav-item " href="../../www/command-line-tools.html">Tools</a>
-      <a class="magick-nav-item " href="../../www/command-line-options.html">Options</a>
-      <a class="magick-nav-item " href="../../www/api.html">Development</a>
-      <a class="magick-nav-item" href="http://www.imagemagick.org/discourse-server/">Community</a>
-      <a class="magick-nav-item navbar-right " href="../../www/search.html">Search</a>
+      <a class="magick-nav-item " href="../index.html">Home</a>
+      <a class="magick-nav-item " href="../binary-releases.html">Download</a>
+      <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
+      <a class="magick-nav-item " href="../command-line-options.html">Options</a>
+      <a class="magick-nav-item " href="../resources.html">Resources</a>
+      <a class="magick-nav-item " href="api.html">Develop</a>
+      <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
+      <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
     </nav>
   </div>
 </div>
 <div class="container">
+<div class="magick-header">
 <p class="text-center"><a href="quantize.html#QuantizeImage">QuantizeImage</a> • <a href="quantize.html#AcquireQuantizeInfo">AcquireQuantizeInfo</a> • <a href="quantize.html#CloneQuantizeInfo">CloneQuantizeInfo</a> • <a href="quantize.html#CompressImageColormap">CompressImageColormap</a> • <a href="quantize.html#DestroyQuantizeInfo">DestroyQuantizeInfo</a> • <a href="quantize.html#GetImageQuantizeError">GetImageQuantizeError</a> • <a href="quantize.html#GetQuantizeInfo">GetQuantizeInfo</a> • <a href="quantize.html#PosterizeImage">PosterizeImage</a> • <a href="quantize.html#QuantizeImage">QuantizeImage</a> • <a href="quantize.html#QuantizeImages">QuantizeImages</a> • <a href="quantize.html#RemapImage">RemapImage</a> • <a href="quantize.html#RemapImages">RemapImages</a> • <a href="quantize.html#SetGrayscaleImage">SetGrayscaleImage</a></p>
 
-<div class="magick-header">
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImage">QuantizeImage</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImage">QuantizeImage</a></h2>
 
 <p>QuantizeImage() takes a standard RGB or monochrome images and quantizes them down to some fixed number of colors.</p>
 
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="AcquireQuantizeInfo">AcquireQuantizeInfo</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="AcquireQuantizeInfo">AcquireQuantizeInfo</a></h2>
 
 <p>AcquireQuantizeInfo() allocates the QuantizeInfo structure.</p>
 
@@ -140,7 +129,7 @@ QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *image_info)
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="CloneQuantizeInfo">CloneQuantizeInfo</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="CloneQuantizeInfo">CloneQuantizeInfo</a></h2>
 
 <p>CloneQuantizeInfo() makes a duplicate of the given quantize info structure, or if quantize info is NULL, a new one.</p>
 
@@ -166,7 +155,7 @@ QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize_info)
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="CompressImageColormap">CompressImageColormap</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="CompressImageColormap">CompressImageColormap</a></h2>
 
 <p>CompressImageColormap() compresses an image colormap by removing any duplicate or unused color entries.</p>
 
@@ -193,7 +182,7 @@ MagickBooleanType CompressImageColormap(Image *image,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="DestroyQuantizeInfo">DestroyQuantizeInfo</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="DestroyQuantizeInfo">DestroyQuantizeInfo</a></h2>
 
 <p>DestroyQuantizeInfo() deallocates memory associated with an QuantizeInfo structure.</p>
 
@@ -215,7 +204,7 @@ QuantizeInfo *DestroyQuantizeInfo(QuantizeInfo *quantize_info)
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="GetImageQuantizeError">GetImageQuantizeError</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="GetImageQuantizeError">GetImageQuantizeError</a></h2>
 
 <p>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:</p>
 
@@ -245,7 +234,7 @@ MagickBooleanType GetImageQuantizeError(Image *image,
 <dt>exception</dt>
 <p>return any errors or warnings in this structure.</p>
 
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="GetQuantizeInfo">GetQuantizeInfo</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="GetQuantizeInfo">GetQuantizeInfo</a></h2>
 
 <p>GetQuantizeInfo() initializes the QuantizeInfo structure.</p>
 
@@ -267,7 +256,7 @@ GetQuantizeInfo(QuantizeInfo *quantize_info)
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="PosterizeImage">PosterizeImage</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="PosterizeImage">PosterizeImage</a></h2>
 
 <p>PosterizeImage() reduces the image to a limited number of colors for a "poster" effect.</p>
 
@@ -302,7 +291,7 @@ MagickBooleanType PosterizeImage(Image *image,const size_t levels,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImage">QuantizeImage</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImage">QuantizeImage</a></h2>
 
 <p>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.</p>
 
@@ -333,7 +322,7 @@ MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImages">QuantizeImages</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="QuantizeImages">QuantizeImages</a></h2>
 
 <p>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.</p>
 
@@ -364,7 +353,7 @@ MagickBooleanType QuantizeImages(const QuantizeInfo *quantize_info,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="RemapImage">RemapImage</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="RemapImage">RemapImage</a></h2>
 
 <p>RemapImage() replaces the colors of an image with the closest of the colors from the reference image.</p>
 
@@ -399,7 +388,7 @@ MagickBooleanType RemapImage(const QuantizeInfo *quantize_info,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="RemapImages">RemapImages</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="RemapImages">RemapImages</a></h2>
 
 <p>RemapImages() replaces the colors of a sequence of images with the closest color from a reference image.</p>
 
@@ -434,7 +423,7 @@ MagickBooleanType RemapImages(const QuantizeInfo *quantize_info,
 
 <dd>  </dd>
 </dl>
-<h2><a href="http://www.imagemagick.org/api/MagickCore/quantize_8c.html" id="SetGrayscaleImage">SetGrayscaleImage</a></h2>
+<h2><a href="http://nextgen.imagemagick.org/api/MagickCore/quantize_8c.html" id="SetGrayscaleImage">SetGrayscaleImage</a></h2>
 
 <p>SetGrayscaleImage() converts an image to a PseudoClass grayscale image.</p>
 
@@ -463,40 +452,19 @@ MagickBooleanType SetGrayscaleImage(Image *image,
 </dl>
 </div>
   <footer class="magick-footer">
-    <div class="magick-nav-item navbar-left">
-      <a href="../../www/support.html">Donate</a>
-    </div>
-    <div class="magick-nav-item navbar-right">
-      <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../../index.html"></a>
-      <noscript>
-        <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
-        <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0"></a>
-      </noscript>
-    </div>
-    <p><a href="../../www/sitemap.html">Sitemap</a> •
-    <a href="../../www/links.html">Related</a> •
-    <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Image Studio</a> •
-    <a href="http://jqmagick.imagemagick.org/">JqMagick</a> •
-    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
+    <p><a href="../support.html">Donate</a> •
+     <a href="../sitemap.html">Sitemap</a> •
+    <a href="../links.html">Related</a> •
+    <a href="../architecture.html">Architecture</a>
 </p>
     <p><a href="quantize.html#">Back to top</a> •
-    <a href="../../www/http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
+    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
+    <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
+        <p><small>©  1999-2015 ImageMagick Studio LLC</small></p>
   </footer>
 </div><!-- /.container -->
 
-  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
-  <script src="../../js/bootstrap.min.js"></script>
-  <script type="text/javascript">
-    /*  */
-    (function() {
-        var s = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
-        s.type = 'text/javascript';
-        s.async = true;
-        s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
-        t.parentNode.insertBefore(s, t);
-    })();
-    /*  */
-  </script>
+  <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
 </div>
 </body>
 </html>