Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 1 | |
| 2 | |
| 3 | |
| 4 | |
cristy | 29dc865 | 2015-05-12 16:26:21 +0000 | [diff] [blame] | 5 | <!DOCTYPE html> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 6 | <html lang="en"> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 7 | <head> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 8 | <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 9 | <title>ImageMagick: MagickCore, C API for ImageMagick: Paint on an Image</title> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 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 Bézier 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"/> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 22 | <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 23 | <meta name="distribution" content="Global"/> |
| 24 | <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> |
| 25 | <link rel="icon" href="../images/wand.png"/> |
| 26 | <link rel="shortcut icon" href="../images/wand.ico"/> |
| 27 | <link rel="stylesheet" href="../css/magick.html"/> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 28 | </head> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 29 | <body> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 30 | <div class="main"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 31 | <div class="magick-masthead"> |
| 32 | <div class="container"> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 33 | <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 34 | style="display:block" |
| 35 | data-ad-client="ca-pub-3129977114552745" |
| 36 | data-ad-slot="6345125851" |
| 37 | data-ad-format="auto"></ins> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 38 | <script> |
Cristy | 542697a | 2015-10-12 20:10:32 -0400 | [diff] [blame] | 39 | (adsbygoogle = window.adsbygoogle || []).push({}); |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 40 | </script> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 41 | <nav class="magick-nav"> |
cristy | 2f563d4 | 2015-05-06 23:36:51 +0000 | [diff] [blame] | 42 | <a class="magick-nav-item " href="../index.html">Home</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 43 | <a class="magick-nav-item " href="../binary-releases.html">Download</a> |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 44 | <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 45 | <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 46 | <a class="magick-nav-item " href="../resources.html">Resources</a> |
| 47 | <a class="magick-nav-item " href="api.html">Develop</a> |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 48 | <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a> |
cristy | a1890f0 | 2015-05-15 23:32:44 +0000 | [diff] [blame] | 49 | <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 50 | </nav> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="container"> |
cristy | 4e638cd | 2015-05-07 16:47:40 +0000 | [diff] [blame] | 54 | <div class="magick-header"> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 55 | <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> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 56 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 57 | <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 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> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 104 | <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 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> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 139 | <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 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> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 181 | <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 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> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 223 | <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 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> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 269 | </div> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 270 | <footer class="magick-footer"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 271 | <p><a href="../support.html">Donate</a> • |
| 272 | <a href="../sitemap.html">Sitemap</a> • |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 273 | <a href="../links.html">Related</a> • |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 274 | <a href="../architecture.html">Architecture</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 275 | </p> |
| 276 | <p><a href="paint.html#">Back to top</a> • |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 277 | <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 278 | <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 279 | <p><small>© 1999-2015 ImageMagick Studio LLC</small></p> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 280 | </footer> |
| 281 | </div><!-- /.container --> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 282 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 283 | <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 284 | <script src="http://nextgen.imagemagick.org/js/magick.html"></script> |
cristy | 44cbd48 | 2013-08-04 20:53:36 +0000 | [diff] [blame] | 285 | </div> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 286 | </body> |
cristy | 5a367e4 | 2015-05-05 12:39:18 +0000 | [diff] [blame] | 287 | </html> |