1 2 3 4 5<!DOCTYPE html> 6<html lang="en"> 7<head> 8 <meta charset="utf-8" /> 9 <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no" /> 10 <title>MagickCore, C API: Paint on an Image @ ImageMagick</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick® to create, edit, compose, or convert bitmap images. You can resize your image, crop it, change its shades and colors, add captions, among other operations." /> 13 <meta name="application-url" content="https://imagemagick.org" /> 14 <meta name="generator" content="PHP" /> 15 <meta name="keywords" content="magickcore, c, api:, 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-2019 ImageMagick Studio LLC" /> 23 <meta name="distribution" content="Global" /> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" /> 25 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 26 <link href="paint.html" rel="canonical" /> 27 <link href="../../images/wand.png" rel="icon" /> 28 <link href="../../images/wand.ico" rel="shortcut icon" /> 29 <link href="../assets/magick.css" rel="stylesheet" /> 30</head> 31<body> 32 <header> 33 <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> 34 <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a> 35 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation"> 36 <span class="navbar-toggler-icon"></span> 37 </button> 38 39 <div class="navbar-collapse collapse" id="navbarsMagick" style=""> 40 <ul class="navbar-nav mr-auto"> 41 <li class="nav-item "> 42 <a class="nav-link" href="quantize.html">Home <span class="sr-only">(current)</span></a> 43 </li> 44 <li class="nav-item "> 45 <a class="nav-link" href="../../www/download.html">Download</a> 46 </li> 47 <li class="nav-item "> 48 <a class="nav-link" href="../../www/command-line-tools.html">Tools</a> 49 </li> 50 <li class="nav-item "> 51 <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a> 52 </li> 53 <li class="nav-item "> 54 <a class="nav-link" href="../../www/resources.html">Resources</a> 55 </li> 56 <li class="nav-item "> 57 <a class="nav-link" href="../../www/develop.html">Develop</a> 58 </li> 59 <li class="nav-item"> 60 <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a> 61 </li> 62 </ul> 63 <form class="form-inline my-2 my-lg-0" action="https://imagemagick.org/script/search.php"> 64 <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search"> 65 <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button> 66 </form> 67 </div> 68 </nav> 69 <div class="container"> 70 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 71 style="display:block" 72 data-ad-client="ca-pub-3129977114552745" 73 data-ad-slot="6345125851" 74 data-ad-format="auto"></ins> 75 <script> 76 (adsbygoogle = window.adsbygoogle || []).push({}); 77 </script> 78 79 </div> 80 </header> 81 <main class="container"> 82 <div class="magick-template"> 83<div class="magick-header"> 84<p class="text-center"><a href="paint.html#FloodfillPaintImage">FloodfillPaintImage</a> • <a href="paint.html#OilPaintImage">OilPaintImage</a> • <a href="paint.html#OpaquePaintImage">OpaquePaintImage</a> • <a href="paint.html#TransparentPaintImage">TransparentPaintImage</a> • <a href="paint.html#TransparentPaintImageChroma">TransparentPaintImageChroma</a></p> 85 86<h2><a href="../../api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2> 87 88<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> 89 90<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> 91 92<p>The format of the FloodfillPaintImage method is:</p> 93 94<pre class="text"> 95MagickBooleanType FloodfillPaintImage(Image *image, 96 const DrawInfo *draw_info,const PixelInfo target, 97 const ssize_t x_offset,const ssize_t y_offset, 98 const MagickBooleanType invert,ExceptionInfo *exception) 99</pre> 100 101<p>A description of each parameter follows:</p> 102 103<dd> 104</dd> 105 106<dd> </dd> 107<dl class="dl-horizontal"> 108<dt>image</dt> 109<dd>the image. </dd> 110 111<dd> </dd> 112<dt>draw_info</dt> 113<dd>the draw info. </dd> 114 115<dd> </dd> 116<dt>target</dt> 117<dd>the RGB value of the target color. </dd> 118 119<dd> </dd> 120<dt>x_offset,y_offset</dt> 121<dd>the starting location of the operation. </dd> 122 123<dd> </dd> 124<dt>invert</dt> 125<dd>paint any pixel that does not match the target color. </dd> 126 127<dd> </dd> 128<dt>exception</dt> 129<dd>return any errors or warnings in this structure. </dd> 130 131<dd> </dd> 132</dl> 133<h2><a href="../../api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2> 134 135<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> 136 137<p>The format of the OilPaintImage method is:</p> 138 139<pre class="text"> 140Image *OilPaintImage(const Image *image,const double radius, 141 const double sigma,ExceptionInfo *exception) 142</pre> 143 144<p>A description of each parameter follows:</p> 145 146<dd> 147</dd> 148 149<dd> </dd> 150<dl class="dl-horizontal"> 151<dt>image</dt> 152<dd>the image. </dd> 153 154<dd> </dd> 155<dt>radius</dt> 156<dd>the radius of the circular neighborhood. </dd> 157 158<dd> </dd> 159<dt>sigma</dt> 160<dd>the standard deviation of the Gaussian, in pixels. </dd> 161 162<dd> </dd> 163<dt>exception</dt> 164<dd>return any errors or warnings in this structure. </dd> 165 166<dd> </dd> 167</dl> 168<h2><a href="../../api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2> 169 170<p>OpaquePaintImage() changes any pixel that matches color with the color defined by fill argument.</p> 171 172<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> 173 174<p>The format of the OpaquePaintImage method is:</p> 175 176<pre class="text"> 177MagickBooleanType OpaquePaintImage(Image *image,const PixelInfo *target, 178 const PixelInfo *fill,const MagickBooleanType invert, 179 ExceptionInfo *exception) 180</pre> 181 182<p>A description of each parameter follows:</p> 183 184<dd> 185</dd> 186 187<dd> </dd> 188<dl class="dl-horizontal"> 189<dt>image</dt> 190<dd>the image. </dd> 191 192<dd> </dd> 193<dt>target</dt> 194<dd>the RGB value of the target color. </dd> 195 196<dd> </dd> 197<dt>fill</dt> 198<dd>the replacement color. </dd> 199 200<dd> </dd> 201<dt>invert</dt> 202<dd>paint any pixel that does not match the target color. </dd> 203 204<dd> </dd> 205<dt>exception</dt> 206<dd>return any errors or warnings in this structure. </dd> 207 208<dd> </dd> 209</dl> 210<h2><a href="../../api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2> 211 212<p>TransparentPaintImage() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p> 213 214<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> 215 216<p>The format of the TransparentPaintImage method is:</p> 217 218<pre class="text"> 219MagickBooleanType TransparentPaintImage(Image *image, 220 const PixelInfo *target,const Quantum opacity, 221 const MagickBooleanType invert,ExceptionInfo *exception) 222</pre> 223 224<p>A description of each parameter follows:</p> 225 226<dd> 227</dd> 228 229<dd> </dd> 230<dl class="dl-horizontal"> 231<dt>image</dt> 232<dd>the image. </dd> 233 234<dd> </dd> 235<dt>target</dt> 236<dd>the target color. </dd> 237 238<dd> </dd> 239<dt>opacity</dt> 240<dd>the replacement opacity value. </dd> 241 242<dd> </dd> 243<dt>invert</dt> 244<dd>paint any pixel that does not match the target color. </dd> 245 246<dd> </dd> 247<dt>exception</dt> 248<dd>return any errors or warnings in this structure. </dd> 249 250<dd> </dd> 251</dl> 252<h2><a href="../../api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2> 253 254<p>TransparentPaintImageChroma() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p> 255 256<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> 257 258<p>The format of the TransparentPaintImageChroma method is:</p> 259 260<pre class="text"> 261MagickBooleanType TransparentPaintImageChroma(Image *image, 262 const PixelInfo *low,const PixelInfo *high,const Quantum opacity, 263 const MagickBooleanType invert,ExceptionInfo *exception) 264</pre> 265 266<p>A description of each parameter follows:</p> 267 268<dd> 269</dd> 270 271<dd> </dd> 272<dl class="dl-horizontal"> 273<dt>image</dt> 274<dd>the image. </dd> 275 276<dd> </dd> 277<dt>low</dt> 278<dd>the low target color. </dd> 279 280<dd> </dd> 281<dt>high</dt> 282<dd>the high target color. </dd> 283 284<dd> </dd> 285<dt>opacity</dt> 286<dd>the replacement opacity value. </dd> 287 288<dd> </dd> 289<dt>invert</dt> 290<dd>paint any pixel that does not match the target color. </dd> 291 292<dd> </dd> 293<dt>exception</dt> 294<dd>return any errors or warnings in this structure. </dd> 295 296<dd> </dd> 297</dl> 298</div> 299 </div> 300 </main><!-- /.container --> 301 <footer class="magick-footer"> 302 <p><a href="../../www/security-policy.html">Security</a> • 303 <a href="../../www/architecture.html">Architecture</a> • 304 <a href="../../www/links.html">Related</a> • 305 <a href="../../www/sitemap.html">Sitemap</a> 306 307 <a href="paint.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a> 308 309 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 310 <a href="../../www/support.html">Donate</a> • 311 <a href="../../www/contact.html">Contact Us</a> 312 <br/> 313 <small>© 1999-2019 ImageMagick Studio LLC</small></p> 314 </footer> 315 316 <!-- Javascript assets --> 317 <script src="../assets/magick.js" crossorigin="anonymous"></script> 318 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script> 319</body> 320</html> 321<!-- Magick Cache 4th January 2019 05:48 -->