1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html version="-//W3C//DTD XHTML 1.1//EN"
4 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:schemaLocation="http://www.w3.org/1999/xhtml
7 http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
9 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
10 <meta name=viewport content="width=device-width, initial-scale=0.3333334">
11 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
12 <title>ImageMagick: MagickCore, C API for ImageMagick: Paint on an Image</title>
13 <meta http-equiv="content-language" content="en-US"/>
14 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
15 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
16 <meta name="application-name" content="ImageMagick"/>
17 <meta name="description" content="A collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats."/>
18 <meta name="application-url" content="http://www.imagemagick.org"/>
19 <meta name="generator" content="PHP"/>
20 <meta name="keywords" content="magickcore, c, api, for, imagemagick:, paint, on, an, image, convert, edit, compose, image, pixel"/>
21 <meta name="rating" content="GENERAL"/>
22 <meta name="robots" content="INDEX, FOLLOW"/>
23 <meta name="generator" content="ImageMagick Studio LLC"/>
24 <meta name="author" content="ImageMagick Studio LLC"/>
25 <meta name="revisit-after" content="2 DAYS"/>
26 <meta name="resource-type" content="document"/>
27 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
28 <meta name="distribution" content="Global"/>
29 <link rel="icon" href="../../images/wand.png"/>
30 <link rel="shortcut icon" href="../../images/wand.ico" type="images/x-icon"/>
31 <link rel="canonical" href="http://www.imagemagick.org" />
32 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
34 <!-- Add jQuery library -->
35 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
37 <!-- Add mousewheel plugin (this is optional) -->
38 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
41 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
42 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
44 <!-- Optionally add helpers - button, thumbnail and/or media -->
45 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
46 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
47 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
49 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
50 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
52 <script type="text/javascript">
53 $(document).ready(function() {
54 $(".fancybox").fancybox();
58 <!-- ImageMagick style -->
59 <style type="text/css" media="all">
60 @import url("../../www/magick.css");
64 <body id="www-imagemagick-org">
66 <script type="text/javascript">
67 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
68 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
69 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
70 })(window,document,'offline-script','//www.google-analytics.com/analytics.js','ga');
72 ga('create', 'UA-40133312-1', 'imagemagick.org');
73 ga('send', 'pageview');
76 <div class="titlebar">
77 <div style="margin: 17px auto; float: left;">
78 <script type="text/javascript">
80 google_ad_client = "pub-3129977114552745";
81 google_ad_slot = "5439289906";
82 google_ad_width = 728;
83 google_ad_height = 90;
86 <script type="text/javascript"
87 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
90 <a href="../../discourse-server">
91 <img src="../../images/logo.jpg"
92 alt="ImageMagick Logo" width="123" height="118"
93 style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
94 <a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
95 <img src="../../images/sprite.jpg"
96 alt="ImageMagick Sprite" width="114" height="118"
97 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
100 <div class="westbar">
103 <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
106 <a title="Binary Releases" href="../../www/binary-releases.html">Binary Releases</a>
109 <a title="Binary Release: Unix" href="../../www/binary-releases.html#unix">Unix</a>
112 <a title="Binary Release: MacOS X" href="../../www/binary-releases.html#macosx">Mac OS X</a>
115 <a title="Binary Release: iOS" href="../../www/binary-releases.html#iOS">iOS</a>
118 <a title="Binary Release: Windows" href="../../www/binary-releases.html#windows">Windows</a>
120 <div class="sep"></div>
122 <a title="Command-line Tools" href="../../www/command-line-tools.html">Command-line Tools</a>
125 <a title="Command-line Tools: Processing" href="../../www/command-line-processing.html">Processing</a>
128 <a title="Command-line Tools: Options" href="../../www/command-line-options.html">Options</a>
131 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
134 <a title="Program Interfaces" href="../../www/api.html">Program Interfaces</a>
137 <a title="Program Interface: MagickWand" href="../../www/magick-wand.html">MagickWand</a>
140 <a title="Program Interface: MagickCore" href="../../www/magick-core.html">MagickCore</a>
143 <a title="Program Interface: PerlMagick" href="../../www/perl-magick.html">PerlMagick</a>
146 <a title="Program Interface: Magick++" href="../../www/magick++.html">Magick++</a>
148 <div class="sep"></div>
150 <a title="Install from Source" href="../../www/install-source.html">Install from Source</a>
153 <a title="Install from Source: Unix" href="../../www/install-source.html#unix">Unix</a>
156 <a title="Install from Source: Windows" href="../../www/install-source.html#windows">Windows</a>
159 <a title="Resources" href="../../www/resources.html">Resources</a>
162 <a title="Architecture" href="../../www/architecture.html">Architecture</a>
165 <a title="Download" href="../../www/download.html">Download</a>
167 <div class="sep"></div>
169 <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
171 <div class="sep"></div>
173 <a title="Site Map" href="../../www/sitemap.html">Site Map</a>
176 <a title="Site Map: Links" href="../../www/links.html">Links</a>
178 <div class="sep"></div>
181 <div class="eastbar">
182 <script type="text/javascript">
189 var po = document.createElement('offline-script');
190 po.type = 'text/javascript';
192 po.src = 'https://apis.google.com/js/plusone.js';
193 var script = document.getElementsByTagName('offline-script')[0];
194 script.parentNode.insertBefore(po, script);
196 var gplusone = document.getElementById("gplusone");
197 gplusone.setAttribute("data-size","medium");
198 gplusone.setAttribute("data-count","true");
201 <script type="text/javascript">
204 var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
205 po.type = 'text/javascript';
207 po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
208 var script = document.getElementsByTagName('offline-script')[0];
209 script.parentNode.insertBefore(po, script);
213 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
215 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
216 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
218 <div class="g-plusone" data-size="standard" data-count="true"></div>
223 <h1>Module paint Methods</h1>
224 <p class="navigation-index">[<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>
226 <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="FloodfillPaintImage">FloodfillPaintImage</a></h2>
227 <div class="doc-section">
229 <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>
231 <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>
233 <p>The format of the FloodfillPaintImage method is:</p>
236 MagickBooleanType FloodfillPaintImage(Image *image,
237 const ChannelType channel,const DrawInfo *draw_info,
238 const MagickPixelPacket target,const ssize_t x_offset,
239 const ssize_t y_offset,const MagickBooleanType invert)
242 <p>A description of each parameter follows:</p>
248 <p>the channel(s).</p>
251 <p>the draw info.</p>
254 <p>the RGB value of the target color.</p>
256 <h5>x_offset,y_offset</h5>
257 <p>the starting location of the operation.</p>
260 <p>paint any pixel that does not match the target color.</p>
263 <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OilPaintImage">OilPaintImage</a></h2>
264 <div class="doc-section">
266 <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>
268 <p>The format of the OilPaintImage method is:</p>
271 Image *OilPaintImage(const Image *image,const double radius,
272 ExceptionInfo *exception)
275 <p>A description of each parameter follows:</p>
281 <p>the radius of the circular neighborhood.</p>
284 <p>return any errors or warnings in this structure.</p>
287 <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="OpaquePaintImage">OpaquePaintImage</a></h2>
288 <div class="doc-section">
290 <p>OpaquePaintImage() changes any pixel that matches color with the color defined by fill.</p>
292 <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>
294 <p>The format of the OpaquePaintImage method is:</p>
297 MagickBooleanType OpaquePaintImage(Image *image,
298 const PixelPacket *target,const PixelPacket *fill,
299 const MagickBooleanType invert)
300 MagickBooleanType OpaquePaintImageChannel(Image *image,
301 const ChannelType channel,const PixelPacket *target,
302 const PixelPacket *fill,const MagickBooleanType invert)
305 <p>A description of each parameter follows:</p>
311 <p>the channel(s).</p>
314 <p>the RGB value of the target color.</p>
317 <p>the replacement color.</p>
320 <p>paint any pixel that does not match the target color.</p>
323 <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImage">TransparentPaintImage</a></h2>
324 <div class="doc-section">
326 <p>TransparentPaintImage() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
328 <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>
330 <p>The format of the TransparentPaintImage method is:</p>
333 MagickBooleanType TransparentPaintImage(Image *image,
334 const MagickPixelPacket *target,const Quantum opacity,
335 const MagickBooleanType invert)
338 <p>A description of each parameter follows:</p>
344 <p>the target color.</p>
347 <p>the replacement opacity value.</p>
350 <p>paint any pixel that does not match the target color.</p>
353 <h2><a href="http://www.imagemagick.org/api/MagickCore/paint_8c.html" id="TransparentPaintImageChroma">TransparentPaintImageChroma</a></h2>
354 <div class="doc-section">
356 <p>TransparentPaintImageChroma() changes the opacity value associated with any pixel that matches color to the value defined by opacity.</p>
358 <p>As there is one fuzz value for the all the channels, the TransparentPaintImage() API 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 take two target pixels (one low and one hight) and all the pixels of an image which are lying between these two pixels are made transparent.</p>
360 <p>The format of the TransparentPaintImage method is:</p>
363 MagickBooleanType TransparentPaintImage(Image *image,
364 const MagickPixelPacket *low,const MagickPixelPacket *hight,
365 const Quantum opacity,const MagickBooleanType invert)
368 <p>A description of each parameter follows:</p>
374 <p>the low target color.</p>
377 <p>the high target color.</p>
380 <p>the replacement opacity value.</p>
383 <p>paint any pixel that does not match the target color.</p>
390 <span id="linkbar-west"> </span>
392 <span id="linkbar-center">
393 <a href="../../discourse-server">Discourse Server</a> •
394 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
395 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
396 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
398 <span id="linkbar-east"> </span>
401 <span id="footer-west">© 1999-2014 ImageMagick Studio LLC</span>
402 <span id="footer-east"> <a href="../../www/contact.html">Contact the Wizards</a></span>
404 <div style="clear: both; margin: 0; width: 100%; "></div>