Home | History | Annotate | Download | only in api
      1 
      2 
      3 
      4 
      5 <!DOCTYPE html>
      6 <html lang="en">
      7 <head>
      8   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
      9     <title>ImageMagick: MagickCore, C API for ImageMagick: Paint on an Image</title>
     10   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     11   <meta name="application-name" content="ImageMagick"/>
     12   <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 Bzier curves."/>
     13   <meta name="application-url" content="http://www.imagemagick.org"/>
     14   <meta name="generator" content="PHP"/>
     15   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, paint, on, an, image, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
     16   <meta name="rating" content="GENERAL"/>
     17   <meta name="robots" content="INDEX, FOLLOW"/>
     18   <meta name="generator" content="ImageMagick Studio LLC"/>
     19   <meta name="author" content="ImageMagick Studio LLC"/>
     20   <meta name="revisit-after" content="2 DAYS"/>
     21   <meta name="resource-type" content="document"/>
     22   <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
     23   <meta name="distribution" content="Global"/>
     24   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
     25   <link rel="icon" href="../image/wand.png"/>
     26   <link rel="shortcut icon" href="../image/wand.ico"/>
     27   <link rel="stylesheet" href="../css/magick.php"/>
     28 </head>
     29 <body>
     30 <div class="main">
     31 <div class="magick-masthead">
     32   <div class="container">
     33     <script async="async" src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
     34          style="display:block"
     35          data-ad-client="ca-pub-3129977114552745"
     36          data-ad-slot="6345125851"
     37          data-ad-format="auto"></ins>
     38     <script>
     39       (adsbygoogle = window.adsbygoogle || []).push({});
     40     </script>
     41     <nav class="magick-nav">
     42       <a class="magick-nav-item " href="../index.php">Home</a>
     43       <a class="magick-nav-item " href="../script/binary-releases.php">Download</a>
     44       <a class="magick-nav-item " href="../script/command-line-tools.php">Tools</a>
     45       <a class="magick-nav-item " href="../script/command-line-options.php">Options</a>
     46       <a class="magick-nav-item " href="../script/resources.php">Resources</a>
     47       <a class="magick-nav-item " href="../script/api.php">Develop</a>
     48       <a class="magick-nav-item " href="../script/search.php">Search</a>
     49       <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
     50     </nav>
     51   </div>
     52 </div>
     53 <div class="container">
     54 <div class="magick-header">
     55 <p class="text-center"><a href="paint.php#FloodfillPaintImage">FloodfillPaintImage</a> &bull; <a href="paint.php#OilPaintImage">OilPaintImage</a> &bull; <a href="paint.php#OpaquePaintImage">OpaquePaintImage</a> &bull; <a href="paint.php#TransparentPaintImage">TransparentPaintImage</a> &bull; <a href="paint.php#TransparentPaintImageChroma">TransparentPaintImageChroma</a></p>
     56 
     57 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2>
     58 
     59 <p>FloodfillPaintImage() changes the color value of any pixel that matches target and is an immediate neighbor.  If the method FillToBorderMethod is specified, the color value is changed for any neighbor pixel that does not match the bordercolor member of image.</p>
     60 
     61 <p>By default target must match a particular pixel color exactly.  However, in many cases two colors may differ by a small amount.  The fuzz member of image defines how much tolerance is acceptable to consider two colors as the same.  For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color for the purposes of the floodfill.</p>
     62 
     63 <p>The format of the FloodfillPaintImage method is:</p>
     64 
     65 <pre class="text">
     66 MagickBooleanType FloodfillPaintImage(Image *image,
     67   const DrawInfo *draw_info,const PixelInfo target,
     68   const ssize_t x_offset,const ssize_t y_offset,
     69   const MagickBooleanType invert,ExceptionInfo *exception)
     70 </pre>
     71 
     72 <p>A description of each parameter follows:</p>
     73 
     74 <dd>
     75 </dd>
     76 
     77 <dd> </dd>
     78 <dl class="dl-horizontal">
     79 <dt>image</dt>
     80 <dd>the image. </dd>
     81 
     82 <dd> </dd>
     83 <dt>draw_info</dt>
     84 <dd>the draw info. </dd>
     85 
     86 <dd> </dd>
     87 <dt>target</dt>
     88 <dd>the RGB value of the target color. </dd>
     89 
     90 <dd> </dd>
     91 <dt>x_offset,y_offset</dt>
     92 <dd>the starting location of the operation. </dd>
     93 
     94 <dd> </dd>
     95 <dt>invert</dt>
     96 <dd>paint any pixel that does not match the target color. </dd>
     97 
     98 <dd> </dd>
     99 <dt>exception</dt>
    100 <dd>return any errors or warnings in this structure. </dd>
    101 
    102 <dd>  </dd>
    103 </dl>
    104 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2>
    105 
    106 <p>OilPaintImage() applies a special effect filter that simulates an oil painting.  Each pixel is replaced by the most frequent color occurring in a circular region defined by radius.</p>
    107 
    108 <p>The format of the OilPaintImage method is:</p>
    109 
    110 <pre class="text">
    111 Image *OilPaintImage(const Image *image,const double radius,
    112   const double sigma,ExceptionInfo *exception)
    113 </pre>
    114 
    115 <p>A description of each parameter follows:</p>
    116 
    117 <dd>
    118 </dd>
    119 
    120 <dd> </dd>
    121 <dl class="dl-horizontal">
    122 <dt>image</dt>
    123 <dd>the image. </dd>
    124 
    125 <dd> </dd>
    126 <dt>radius</dt>
    127 <dd>the radius of the circular neighborhood. </dd>
    128 
    129 <dd> </dd>
    130 <dt>sigma</dt>
    131 <dd>the standard deviation of the Gaussian, in pixels. </dd>
    132 
    133 <dd> </dd>
    134 <dt>exception</dt>
    135 <dd>return any errors or warnings in this structure. </dd>
    136 
    137 <dd>  </dd>
    138 </dl>
    139 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2>
    140 
    141 <p>OpaquePaintImage() changes any pixel that matches color with the color defined by fill argument.</p>
    142 
    143 <p>By default color must match a particular pixel color exactly.  However, in many cases two colors may differ by a small amount.  Fuzz defines how much tolerance is acceptable to consider two colors as the same.  For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.</p>
    144 
    145 <p>The format of the OpaquePaintImage method is:</p>
    146 
    147 <pre class="text">
    148 MagickBooleanType OpaquePaintImage(Image *image,const PixelInfo *target,
    149   const PixelInfo *fill,const MagickBooleanType invert,
    150   ExceptionInfo *exception)
    151 </pre>
    152 
    153 <p>A description of each parameter follows:</p>
    154 
    155 <dd>
    156 </dd>
    157 
    158 <dd> </dd>
    159 <dl class="dl-horizontal">
    160 <dt>image</dt>
    161 <dd>the image. </dd>
    162 
    163 <dd> </dd>
    164 <dt>target</dt>
    165 <dd>the RGB value of the target color. </dd>
    166 
    167 <dd> </dd>
    168 <dt>fill</dt>
    169 <dd>the replacement color. </dd>
    170 
    171 <dd> </dd>
    172 <dt>invert</dt>
    173 <dd>paint any pixel that does not match the target color. </dd>
    174 
    175 <dd> </dd>
    176 <dt>exception</dt>
    177 <dd>return any errors or warnings in this structure. </dd>
    178 
    179 <dd>  </dd>
    180 </dl>
    181 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2>
    182 
    183 <p>TransparentPaintImage() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
    184 
    185 <p>By default color must match a particular pixel color exactly.  However, in many cases two colors may differ by a small amount.  Fuzz defines how much tolerance is acceptable to consider two colors as the same.  For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color.</p>
    186 
    187 <p>The format of the TransparentPaintImage method is:</p>
    188 
    189 <pre class="text">
    190 MagickBooleanType TransparentPaintImage(Image *image,
    191   const PixelInfo *target,const Quantum opacity,
    192   const MagickBooleanType invert,ExceptionInfo *exception)
    193 </pre>
    194 
    195 <p>A description of each parameter follows:</p>
    196 
    197 <dd>
    198 </dd>
    199 
    200 <dd> </dd>
    201 <dl class="dl-horizontal">
    202 <dt>image</dt>
    203 <dd>the image. </dd>
    204 
    205 <dd> </dd>
    206 <dt>target</dt>
    207 <dd>the target color. </dd>
    208 
    209 <dd> </dd>
    210 <dt>opacity</dt>
    211 <dd>the replacement opacity value. </dd>
    212 
    213 <dd> </dd>
    214 <dt>invert</dt>
    215 <dd>paint any pixel that does not match the target color. </dd>
    216 
    217 <dd> </dd>
    218 <dt>exception</dt>
    219 <dd>return any errors or warnings in this structure. </dd>
    220 
    221 <dd>  </dd>
    222 </dl>
    223 <h2><a href="http://nextgen.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2>
    224 
    225 <p>TransparentPaintImageChroma() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
    226 
    227 <p>As there is one fuzz value for the all the channels, TransparentPaintImage() is not suitable for the operations like chroma, where the tolerance for similarity of two color component (RGB) can be different. Thus we define this method to take two target pixels (one low and one high) and all the pixels of an image which are lying between these two pixels are made transparent.</p>
    228 
    229 <p>The format of the TransparentPaintImageChroma method is:</p>
    230 
    231 <pre class="text">
    232 MagickBooleanType TransparentPaintImageChroma(Image *image,
    233   const PixelInfo *low,const PixelInfo *high,const Quantum opacity,
    234   const MagickBooleanType invert,ExceptionInfo *exception)
    235 </pre>
    236 
    237 <p>A description of each parameter follows:</p>
    238 
    239 <dd>
    240 </dd>
    241 
    242 <dd> </dd>
    243 <dl class="dl-horizontal">
    244 <dt>image</dt>
    245 <dd>the image. </dd>
    246 
    247 <dd> </dd>
    248 <dt>low</dt>
    249 <dd>the low target color. </dd>
    250 
    251 <dd> </dd>
    252 <dt>high</dt>
    253 <dd>the high target color. </dd>
    254 
    255 <dd> </dd>
    256 <dt>opacity</dt>
    257 <dd>the replacement opacity value. </dd>
    258 
    259 <dd> </dd>
    260 <dt>invert</dt>
    261 <dd>paint any pixel that does not match the target color. </dd>
    262 
    263 <dd> </dd>
    264 <dt>exception</dt>
    265 <dd>return any errors or warnings in this structure. </dd>
    266 
    267 <dd>  </dd>
    268 </dl>
    269 </div>
    270   <footer class="magick-footer">
    271     <p><a href="../script/support.php">Donate</a> 
    272      <a href="../script/sitemap.php">Sitemap</a> 
    273     <a href="../script/links.php">Related</a> 
    274     <a href="../script/architecture.php">Architecture</a>
    275 </p>
    276     <p><a href="paint.php#">Back to top</a> 
    277     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 
    278     <a href="../script/contact.php">Contact Us</a></p>
    279         <p><small>  1999-2016 ImageMagick Studio LLC</small></p>
    280   </footer>
    281 </div><!-- /.container -->
    282 
    283   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    284   <script src="http://nextgen.imagemagick.org/js/magick.php"></script>
    285 </div>
    286 </body>
    287 </html>
    288