blob: 685a0c2114a0445bd963dc864588e25c6520620f [file] [log] [blame]
Cristy594d2772015-11-15 10:47:42 -05001
2
3
4
cristy29dc8652015-05-12 16:26:21 +00005<!DOCTYPE html>
cristy44443b92015-05-05 00:06:07 +00006<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00007<head>
Cristy594d2772015-11-15 10:47:42 -05008 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
cristy29f2c972015-07-28 13:37:46 +00009 <title>ImageMagick: MagickCore, C API for ImageMagick: Paint on an Image</title>
Cristy594d2772015-11-15 10:47:42 -050010 <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"/>
Cristyce4a3552015-12-14 13:53:35 -050022 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/>
Cristy594d2772015-11-15 10:47:42 -050023 <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"/>
cristy06f63f22012-10-31 00:50:07 +000028</head>
cristy44443b92015-05-05 00:06:07 +000029<body>
cristy06f63f22012-10-31 00:50:07 +000030<div class="main">
cristy44443b92015-05-05 00:06:07 +000031<div class="magick-masthead">
32 <div class="container">
Cristye93be682015-11-26 09:07:51 -050033 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
Cristy594d2772015-11-15 10:47:42 -050034 style="display:block"
35 data-ad-client="ca-pub-3129977114552745"
36 data-ad-slot="6345125851"
37 data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000038 <script>
Cristy542697a2015-10-12 20:10:32 -040039 (adsbygoogle = window.adsbygoogle || []).push({});
cristy44443b92015-05-05 00:06:07 +000040 </script>
cristy44443b92015-05-05 00:06:07 +000041 <nav class="magick-nav">
cristy2f563d42015-05-06 23:36:51 +000042 <a class="magick-nav-item " href="../index.html">Home</a>
cristyea2793e2015-05-31 16:52:26 +000043 <a class="magick-nav-item " href="../binary-releases.html">Download</a>
cristy38185362015-05-07 20:09:56 +000044 <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
Cristye93be682015-11-26 09:07:51 -050045 <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
cristyea2793e2015-05-31 16:52:26 +000046 <a class="magick-nav-item " href="../resources.html">Resources</a>
47 <a class="magick-nav-item " href="api.html">Develop</a>
cristy5b8fe762015-06-09 16:24:03 +000048 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
cristya1890f02015-05-15 23:32:44 +000049 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristy44443b92015-05-05 00:06:07 +000050 </nav>
51 </div>
52</div>
53<div class="container">
cristy4e638cd2015-05-07 16:47:40 +000054<div class="magick-header">
Cristy594d2772015-11-15 10:47:42 -050055<p class="text-center"><a href="paint.html#FloodfillPaintImage">FloodfillPaintImage</a> &#8226; <a href="paint.html#OilPaintImage">OilPaintImage</a> &#8226; <a href="paint.html#OpaquePaintImage">OpaquePaintImage</a> &#8226; <a href="paint.html#TransparentPaintImage">TransparentPaintImage</a> &#8226; <a href="paint.html#TransparentPaintImageChroma">TransparentPaintImageChroma</a></p>
cristy06f63f22012-10-31 00:50:07 +000056
Cristye93be682015-11-26 09:07:51 -050057<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2>
cristycecc9492015-06-09 16:53:50 +000058
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">
66MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500104<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000105
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">
111Image *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>
Cristye93be682015-11-26 09:07:51 -0500139<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000140
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">
148MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500181<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2>
cristycecc9492015-06-09 16:53:50 +0000182
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">
190MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500223<h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2>
cristycecc9492015-06-09 16:53:50 +0000224
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">
232MagickBooleanType 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>
cristy06f63f22012-10-31 00:50:07 +0000269</div>
cristy44443b92015-05-05 00:06:07 +0000270 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000271 <p><a href="../support.html">Donate</a>
272 <a href="../sitemap.html">Sitemap</a>
cristy38185362015-05-07 20:09:56 +0000273 <a href="../links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000274 <a href="../architecture.html">Architecture</a>
cristy44443b92015-05-05 00:06:07 +0000275</p>
276 <p><a href="paint.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000277 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000278 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristyce4a3552015-12-14 13:53:35 -0500279 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristy44443b92015-05-05 00:06:07 +0000280 </footer>
281</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000282
Cristye93be682015-11-26 09:07:51 -0500283 <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
cristy29f2c972015-07-28 13:37:46 +0000284 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristy44cbd482013-08-04 20:53:36 +0000285</div>
cristy06f63f22012-10-31 00:50:07 +0000286</body>
cristy5a367e42015-05-05 12:39:18 +0000287</html>