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