blob: 21e3ca29caa2bb8c5c3e51071884d863d908948a [file] [log] [blame]
cristy44443b92015-05-05 00:06:07 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00003<head>
cristy44443b92015-05-05 00:06:07 +00004 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <meta name="viewport" content="width=device-width, initial-scale=1">
cristyffb69ed2010-12-25 00:06:48 +00007 <title>ImageMagick: MagickCore, C API for ImageMagick: Paint on an Image</title>
cristy44443b92015-05-05 00:06:07 +00008 <meta http-equiv="content-language" content="en-US">
9 <meta http-equiv="content-type" content="text/html; charset=utf-8">
10 <meta http-equiv="reply-to" content="magick-users@imagemagick.org">
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">
22 <meta name="copyright" content="Copyright (c) 1999-2012 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="../../images/wand.png">
26 <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon">
27 <link rel="stylesheet" href="css/bootstrap.min.css">
28 <link rel="stylesheet" href="css/magick.css">
cristy06f63f22012-10-31 00:50:07 +000029</head>
30
cristy44443b92015-05-05 00:06:07 +000031<body>
cristy06f63f22012-10-31 00:50:07 +000032<div class="main">
cristy44443b92015-05-05 00:06:07 +000033<div class="magick-masthead">
34 <div class="container">
35 <script type="text/javascript">
36 <!--
37 google_ad_client = "pub-3129977114552745";
38 google_ad_slot = "5439289906";
39 google_ad_width = 728;
40 google_ad_height = 90;
41 //-->
42 </script>
43 <center><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
44 </script></center>
45 <nav class="magick-nav">
46 <a class="magick-nav-item " href="../../index.html">Home</a>
47 <a class="magick-nav-item " href="../../www/binary-releases.html">Downloads</a>
48 <a class="magick-nav-item " href="../../www/command-line-tools.html">Tools</a>
49 <a class="magick-nav-item " href="../../www/command-line-options.html">Options</a>
50 <a class="magick-nav-item " href="../../www/api.html">Development</a>
51 <a class="magick-nav-item" href="http://www.imagemagick.org/discourse-server/">Community</a>
52 <a class="magick-nav-item navbar-right " href="http://www.imagemagick.org/script/search.php">Search</a>
53 </nav>
54 </div>
55</div>
56<div class="container">
57<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>
cristy06f63f22012-10-31 00:50:07 +000058
cristy44443b92015-05-05 00:06:07 +000059<div class="magick-header">
cristy20398432011-08-11 01:31:50 +000060<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2>
cristy20398432011-08-11 01:31:50 +000061
62<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>
63
cristy44443b92015-05-05 00:06:07 +000064<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>
cristy20398432011-08-11 01:31:50 +000065
66<p>The format of the FloodfillPaintImage method is:</p>
67
cristy44443b92015-05-05 00:06:07 +000068<pre class="text">
69MagickBooleanType FloodfillPaintImage(Image *image,
70 const DrawInfo *draw_info,const PixelInfo target,
71 const ssize_t x_offset,const ssize_t y_offset,
72 const MagickBooleanType invert,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +000073</pre>
74
75<p>A description of each parameter follows:</p>
76
cristy44443b92015-05-05 00:06:07 +000077<dd>
78</dd>
cristy20398432011-08-11 01:31:50 +000079
cristy44443b92015-05-05 00:06:07 +000080<dd> </dd>
81<dl class="dl-horizontal">
82<dt>image</dt>
83<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +000084
cristy44443b92015-05-05 00:06:07 +000085<dd> </dd>
86<dt>draw_info</dt>
87<dd>the draw info. </dd>
cristy20398432011-08-11 01:31:50 +000088
cristy44443b92015-05-05 00:06:07 +000089<dd> </dd>
90<dt>target</dt>
91<dd>the RGB value of the target color. </dd>
cristy20398432011-08-11 01:31:50 +000092
cristy44443b92015-05-05 00:06:07 +000093<dd> </dd>
94<dt>x_offset,y_offset</dt>
95<dd>the starting location of the operation. </dd>
cristy20398432011-08-11 01:31:50 +000096
cristy44443b92015-05-05 00:06:07 +000097<dd> </dd>
98<dt>invert</dt>
99<dd>paint any pixel that does not match the target color. </dd>
cristy20398432011-08-11 01:31:50 +0000100
cristy44443b92015-05-05 00:06:07 +0000101<dd> </dd>
102<dt>exception</dt>
103<dd>return any errors or warnings in this structure. </dd>
104
105<dd> </dd>
106</dl>
cristy20398432011-08-11 01:31:50 +0000107<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000108
109<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>
110
111<p>The format of the OilPaintImage method is:</p>
112
cristy44443b92015-05-05 00:06:07 +0000113<pre class="text">
114Image *OilPaintImage(const Image *image,const double radius,
115 const double sigma,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000116</pre>
117
118<p>A description of each parameter follows:</p>
119
cristy44443b92015-05-05 00:06:07 +0000120<dd>
121</dd>
cristy20398432011-08-11 01:31:50 +0000122
cristy44443b92015-05-05 00:06:07 +0000123<dd> </dd>
124<dl class="dl-horizontal">
125<dt>image</dt>
126<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000127
cristy44443b92015-05-05 00:06:07 +0000128<dd> </dd>
129<dt>radius</dt>
130<dd>the radius of the circular neighborhood. </dd>
cristy20398432011-08-11 01:31:50 +0000131
cristy44443b92015-05-05 00:06:07 +0000132<dd> </dd>
133<dt>sigma</dt>
134<dd>the standard deviation of the Gaussian, in pixels. </dd>
135
136<dd> </dd>
137<dt>exception</dt>
138<dd>return any errors or warnings in this structure. </dd>
139
140<dd> </dd>
141</dl>
cristy20398432011-08-11 01:31:50 +0000142<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000143
cristy44443b92015-05-05 00:06:07 +0000144<p>OpaquePaintImage() changes any pixel that matches color with the color defined by fill argument.</p>
cristy20398432011-08-11 01:31:50 +0000145
cristy44443b92015-05-05 00:06:07 +0000146<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>
cristy20398432011-08-11 01:31:50 +0000147
148<p>The format of the OpaquePaintImage method is:</p>
149
cristy44443b92015-05-05 00:06:07 +0000150<pre class="text">
151MagickBooleanType OpaquePaintImage(Image *image,const PixelInfo *target,
152 const PixelInfo *fill,const MagickBooleanType invert,
153 ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000154</pre>
155
156<p>A description of each parameter follows:</p>
157
cristy44443b92015-05-05 00:06:07 +0000158<dd>
159</dd>
cristy20398432011-08-11 01:31:50 +0000160
cristy44443b92015-05-05 00:06:07 +0000161<dd> </dd>
162<dl class="dl-horizontal">
163<dt>image</dt>
164<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000165
cristy44443b92015-05-05 00:06:07 +0000166<dd> </dd>
167<dt>target</dt>
168<dd>the RGB value of the target color. </dd>
cristy20398432011-08-11 01:31:50 +0000169
cristy44443b92015-05-05 00:06:07 +0000170<dd> </dd>
171<dt>fill</dt>
172<dd>the replacement color. </dd>
cristy20398432011-08-11 01:31:50 +0000173
cristy44443b92015-05-05 00:06:07 +0000174<dd> </dd>
175<dt>invert</dt>
176<dd>paint any pixel that does not match the target color. </dd>
cristy20398432011-08-11 01:31:50 +0000177
cristy44443b92015-05-05 00:06:07 +0000178<dd> </dd>
179<dt>exception</dt>
180<dd>return any errors or warnings in this structure. </dd>
181
182<dd> </dd>
183</dl>
cristy20398432011-08-11 01:31:50 +0000184<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2>
cristy20398432011-08-11 01:31:50 +0000185
186<p>TransparentPaintImage() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
187
cristy44443b92015-05-05 00:06:07 +0000188<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>
cristy20398432011-08-11 01:31:50 +0000189
190<p>The format of the TransparentPaintImage method is:</p>
191
cristy44443b92015-05-05 00:06:07 +0000192<pre class="text">
193MagickBooleanType TransparentPaintImage(Image *image,
194 const PixelInfo *target,const Quantum opacity,
195 const MagickBooleanType invert,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000196</pre>
197
198<p>A description of each parameter follows:</p>
199
cristy44443b92015-05-05 00:06:07 +0000200<dd>
201</dd>
cristy20398432011-08-11 01:31:50 +0000202
cristy44443b92015-05-05 00:06:07 +0000203<dd> </dd>
204<dl class="dl-horizontal">
205<dt>image</dt>
206<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000207
cristy44443b92015-05-05 00:06:07 +0000208<dd> </dd>
209<dt>target</dt>
210<dd>the target color. </dd>
cristy20398432011-08-11 01:31:50 +0000211
cristy44443b92015-05-05 00:06:07 +0000212<dd> </dd>
213<dt>opacity</dt>
214<dd>the replacement opacity value. </dd>
cristy20398432011-08-11 01:31:50 +0000215
cristy44443b92015-05-05 00:06:07 +0000216<dd> </dd>
217<dt>invert</dt>
218<dd>paint any pixel that does not match the target color. </dd>
219
220<dd> </dd>
221<dt>exception</dt>
222<dd>return any errors or warnings in this structure. </dd>
223
224<dd> </dd>
225</dl>
cristy20398432011-08-11 01:31:50 +0000226<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2>
cristy20398432011-08-11 01:31:50 +0000227
228<p>TransparentPaintImageChroma() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
229
cristy44443b92015-05-05 00:06:07 +0000230<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>
cristy20398432011-08-11 01:31:50 +0000231
cristy44443b92015-05-05 00:06:07 +0000232<p>The format of the TransparentPaintImageChroma method is:</p>
cristy20398432011-08-11 01:31:50 +0000233
cristy44443b92015-05-05 00:06:07 +0000234<pre class="text">
235MagickBooleanType TransparentPaintImageChroma(Image *image,
236 const PixelInfo *low,const PixelInfo *high,const Quantum opacity,
237 const MagickBooleanType invert,ExceptionInfo *exception)
cristy20398432011-08-11 01:31:50 +0000238</pre>
239
240<p>A description of each parameter follows:</p>
241
cristy44443b92015-05-05 00:06:07 +0000242<dd>
243</dd>
cristy20398432011-08-11 01:31:50 +0000244
cristy44443b92015-05-05 00:06:07 +0000245<dd> </dd>
246<dl class="dl-horizontal">
247<dt>image</dt>
248<dd>the image. </dd>
cristy20398432011-08-11 01:31:50 +0000249
cristy44443b92015-05-05 00:06:07 +0000250<dd> </dd>
251<dt>low</dt>
252<dd>the low target color. </dd>
cristy20398432011-08-11 01:31:50 +0000253
cristy44443b92015-05-05 00:06:07 +0000254<dd> </dd>
255<dt>high</dt>
256<dd>the high target color. </dd>
cristy20398432011-08-11 01:31:50 +0000257
cristy44443b92015-05-05 00:06:07 +0000258<dd> </dd>
259<dt>opacity</dt>
260<dd>the replacement opacity value. </dd>
cristy20398432011-08-11 01:31:50 +0000261
cristy44443b92015-05-05 00:06:07 +0000262<dd> </dd>
263<dt>invert</dt>
264<dd>paint any pixel that does not match the target color. </dd>
cristy06f63f22012-10-31 00:50:07 +0000265
cristy44443b92015-05-05 00:06:07 +0000266<dd> </dd>
267<dt>exception</dt>
268<dd>return any errors or warnings in this structure. </dd>
269
270<dd> </dd>
271</dl>
cristy06f63f22012-10-31 00:50:07 +0000272</div>
cristy44443b92015-05-05 00:06:07 +0000273 <footer class="magick-footer">
274 <div class="magick-nav-item navbar-left">
275 <a href="../../www/support.html">Donations</a>
276 </div>
277 <div class="magick-nav-item navbar-right">
278 <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="../../index.html"></a>
279 <noscript>
280 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
281 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0"></a>
282 </noscript>
283 </div>
284 <p><a href="../../www/sitemap.html">Sitemap</a>
285 <a href="../../www/links.html">Related</a>
286 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Image Studio</a>
287 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
288 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
289</p>
290 <p><a href="paint.html#">Back to top</a>
291 <a href="../../www/contact.html">Contact Us</a></p>
292 </footer>
293</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000294
cristy44443b92015-05-05 00:06:07 +0000295 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
296 <script src="../../js/bootstrap.min.js"></script>
297 <script type="text/javascript">
298 /* */
299 (function() {
300 var s = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
301 s.type = 'text/javascript';
302 s.async = true;
303 s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
304 t.parentNode.insertBefore(s, t);
305 })();
306 /* */
307 </script>
cristy44cbd482013-08-04 20:53:36 +0000308</div>
cristy06f63f22012-10-31 00:50:07 +0000309</body>
cristy5a367e42015-05-05 12:39:18 +0000310</html>