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