blob: 2fb0ecf4b1bac77ed3a2fb4d8e7ff24417fdb0d3 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<head>
5 <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U=" />
6 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf" />
7 <style type="text/css" media="screen,projection"><!--
8 @import url("../www/magick.css");
9 --></style>
10 <link rel="shortcut icon" href="../images/wand.ico" type="images/vnd.microsoft.icon"/>
11 <title>ImageMagick: Magick Vector Graphics</title>
12 <meta http-equiv="Content-Language" content="en-US"/>
13 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
14 <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
15 <meta name="Generator" content="PHP"/>
16 <meta name="Keywords" content="magick, vector, graphics, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing"/>
17 <meta name="Description" content="ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically."/>
18 <meta name="Rating" content="GENERAL"/>
19 <meta name="Robots" content="INDEX, FOLLOW"/>
20 <meta name="Generator" content="ImageMagick Studio LLC"/>
21 <meta name="Author" content="ImageMagick Studio LLC"/>
22 <meta name="Revisit-after" content="2 DAYS"/>
23 <meta name="Resource-type" content="document"/>
24 <meta name="Copyright" content="Copyright (c) 1999-2009 ImageMagick Studio LLC"/>
25 <meta name="Distribution" content="Global"/>
26</head>
27
28<body id="www-imagemagick-org">
29<div class="titlebar">
30<a href="../index.html">
31 <img src="../images/script.png" alt="[ImageMagick]"
32 style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>
33<a href="http://www.networkredux.com">
34 <img src="../images/networkredux.png" alt="[sponsor]"
35 style="margin: 45px auto; border: 0px; float: left;" /></a>
36<a href="http://www.imagemagick.org/discourse-server/">
37 <img src="../images/logo.jpg" alt=""
38 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
39<a href="../index.html">
40 <img src="../images/sprite.jpg" alt=""
41 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
42</div>
43
44<div class="eastbar">
45
46<div class="menu">
47 <a href="../index.html">About ImageMagick</a>
48</div>
49<div class="sep"></div>
50<div class="menu">
51 <a href="../www/command-line-tools.html">Command-line Tools</a>
52</div>
53<div class="sub">
54 <a href="../www/command-line-processing.html">Processing</a>
55</div>
56<div class="sub">
57 <a href="../www/command-line-options.html">Options</a>
58</div>
59<div class="sub">
60 <a href="http://www.imagemagick.org/Usage/">Usage</a>
61</div>
62<div class="menu">
63 <a href="../www/api.html">Program Interfaces</a>
64</div>
65<div class="sub">
66 <a href="../www/magick-wand.html">MagickWand</a>
67</div>
68<div class="sub">
69 <a href="../www/magick-core.html">MagickCore</a>
70</div>
71<div class="sub">
72 <a href="../www/perl-magick.html">PerlMagick</a>
73</div>
74<div class="sub">
75 <a href="../Magick++/">Magick++</a>
76</div>
77<div class="menu">
78 <a href="../www/architecture.html">Architecture</a>
79</div>
80<div class="sep"></div>
81<div class="menu">
82 <a href="../www/install-source.html">Install from Source</a>
83</div>
84<div class="sub">
85 <a href="../www/install-source.html#unix">Unix</a>
86</div>
87<div class="sub">
88 <a href="../www/install-source.html#windows">Windows</a>
89 </div>
90<div class="menu">
91 <a href="../www/binary-releases.html">Binary Releases</a>
92</div>
93<div class="sub">
94 <a href="../www/binary-releases.html#unix">Unix</a>
95</div>
96<div class="sub">
97 <a href="../www/binary-releases.html#macosx">Mac OS X</a>
98</div>
99<div class="sub">
100 <a href="../www/binary-releases.html#windows">Windows</a>
101</div>
102<div class="menu">
103 <a href="../www/resources.html">Resources</a>
104</div>
105<div class="sep"></div>
106<div class="menu">
107 <a href="../www/download.html">Download</a>
108</div>
109<div class="sep"></div>
110<div class="menu">
111 <a href="http://www.imagemagick.org/script/search.php">Search</a>
112</div>
113<div class="sep"></div>
114<div class="menu">
115 <a href="../www/sitemap.html">Site Map</a>
116</div>
117<div class="sub">
118 <a href="../www/links.html">Links</a>
119</div>
120<div class="sep"></div>
121<div class="menu">
122 <a href="../www/sponsors.html">Sponsors:</a>
123
124<div class="sponsbox">
125<div class="sponsor">
126 <a href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012001200 allesdruck.de-->
127</div>
128<div class="sponsor">
129 <a href="http://www.blumenversender.com">Blumenversand</a><!-- 200911010120 -->
130</div>
131<div class="sponsor">
132 <a href="http://www.print24.de/">Druckerei</a><!-- 200911010480 -->
133</div>
134<div class="sponsor">
135 <a href="http://www.who-sells-it.com/">Free Catalogs</a><!-- 201002010000 -->
136</div>
137<div class="sponsor">
138 <a href="http://www.online-kredit-index.de">Kredit</a><!-- 201001010120 Buchhorn -->
139</div>
140</div>
141</div>
142
143
144</div>
145
146<div class="main">
147
148
149<p class="navigation-index">[<a href="#intro">Introduction to Vector Graphics</a> &bull; <a href="#overview">MVG Overview</a> &bull; <a href="#primitives">Drawing Primitives</a>]</p>
150
151<h2><a name="intro"></a>Introduction to Vector Graphics</h2>
152<div class="doc-section">
153
154<p>This specification defines the features and syntax for Magick Vector Graphics (MVG), a modularized language for describing two-dimensional vector and mixed vector/raster graphics in ImageMagick. You can use the language to draw from the
155command line, from an MVG file, from an <a href="http://www.w3.org/TR/SVG/" >SVG -- Scalable Vector Graphics</a> file or from one of the ImageMagick <a href="../www/api.html">program interfaces</a>. Use this command, for example, to render an arc:</p>
156
157<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert -size 100x60 xc:skyblue -fill white -stroke black \ <br/>
158 -draw "path 'M 30,40 A 30,20 20 0,0 70,20 A 30,20 20 1,0 30,40 Z '" \ <br/>
159 arc.png</span></p>
160<p>and here is the result:</p>
161
162<p class="image">
163 <a href="../images/arc.png"><img src="../images/arc.png" width="100" height="60" alt="arc" /></a>
164</p>
165
166<p>When the drawing gets sufficiently complex, we recommend you assemble the graphic primitives into a MVG file. For our example, we use <a href="../www/source/piechart.mvg">piechart.mvg</a>:</p>
167
168<div class="viewport">
169<pre class="code">
170 push graphic-context
171 viewbox 0 0 624 369
172 affine 0.283636 0 0 0.283846 -0 -0
173 push graphic-context
174 push graphic-context
175 fill 'darkslateblue'
176 stroke 'blue'
177 stroke-width 1
178 rectangle 1,1 2199,1299
179 pop graphic-context
180 push graphic-context
181 font-size 40
182 fill 'white'
183 stroke-width 1
184 text 600,1100 'Average: 20.0'
185 pop graphic-context
186 push graphic-context
187 fill 'red'
188 stroke 'black'
189 stroke-width 5
190 path 'M700.0,600.0 L340.0,600.0 A360.0,360.0 0 0,1 408.1452123287954,389.2376150414973 z'
191 pop graphic-context
192 push graphic-context
193 font-size 40
194 fill 'white'
195 stroke-width 1
196 text 1400,140 'MagickWand for PHP'
197 pop graphic-context
198 push graphic-context
199 font-size 30
200 fill 'white'
201 stroke-width 1
202 text 1800,140 '(10.0%)'
203 pop graphic-context
204 push graphic-context
205 fill 'red'
206 stroke 'black'
207 stroke-width 4
208 rectangle 1330,100 1370,140
209 pop graphic-context
210 push graphic-context
211 fill 'yellow'
212 stroke 'black'
213 stroke-width 5
214 path 'M700.0,600.0 L408.1452123287954,389.2376150414973 A360.0,360.0 0 0,1 976.5894480359858,369.56936567559273 z'
215 pop graphic-context
216 push graphic-context
217 font-size 40
218 fill 'white'
219 stroke-width 1
220 text 1400,220 'MagickCore'
221 pop graphic-context
222 push graphic-context
223 font-size 30
224 fill 'white'
225 stroke-width 1
226 text 1800,220 '(29.0%)'
227 pop graphic-context
228 push graphic-context
229 fill 'yellow'
230 stroke 'black'
231 stroke-width 4
232 rectangle 1330,180 1370,220
233 pop graphic-context
234 push graphic-context
235 fill 'fuchsia'
236 stroke 'black'
237 stroke-width 5
238 path 'M700.0,600.0 L976.5894480359858,369.56936567559273 A360.0,360.0 0 0,1 964.2680466142854,844.4634932636567 z'
239 pop graphic-context
240 push graphic-context
241 font-size 40
242 fill 'white'
243 stroke-width 1
244 text 1400,300 'MagickWand'
245 pop graphic-context
246 push graphic-context
247 font-size 30
248 fill 'white'
249 stroke-width 1
250 text 1800,300 '(22.9%)'
251 pop graphic-context
252 push graphic-context
253 fill 'fuchsia'
254 stroke 'black'
255 stroke-width 4
256 rectangle 1330,260 1370,300
257 pop graphic-context
258 push graphic-context
259 fill 'blue'
260 stroke 'black'
261 stroke-width 5
262 path 'M700.0,600.0 L964.2680466142854,844.4634932636567 A360.0,360.0 0 0,1 757.853099990584,955.3210081341651 z'
263 pop graphic-context
264 push graphic-context
265 font-size 40
266 fill 'white'
267 stroke-width 1
268 text 1400,380 'JMagick'
269 pop graphic-context
270 push graphic-context
271 font-size 30
272 fill 'white'
273 stroke-width 1
274 text 1800,380 '(10.6%)'
275 pop graphic-context
276 push graphic-context
277 fill 'blue'
278 stroke 'black'
279 stroke-width 4
280 rectangle 1330,340 1370,380
281 pop graphic-context
282 push graphic-context
283 fill 'lime'
284 stroke 'black'
285 stroke-width 5
286 path 'M700.0,600.0 L757.853099990584,955.3210081341651 A360.0,360.0 0 0,1 340.0,600.0 z'
287 pop graphic-context
288 push graphic-context
289 font-size 40
290 fill 'white'
291 stroke-width 1
292 text 1400,460 'Magick++'
293 pop graphic-context
294 push graphic-context
295 font-size 30
296 fill 'white'
297 stroke-width 1
298 text 1800,460 '(27.5%)'
299 pop graphic-context
300 push graphic-context
301 fill 'lime'
302 stroke 'black'
303 stroke-width 4
304 rectangle 1330,420 1370,460
305 pop graphic-context
306 push graphic-context
307 font-size 100
308 fill 'white'
309 stroke-width 1
310 text 100,150 'ImageMagick'
311 pop graphic-context
312 push graphic-context
313 fill 'none'
314 stroke 'black'
315 stroke-width 5
316 circle 700,600 700,960
317 pop graphic-context
318 pop graphic-context
319 pop graphic-context
320</pre>
321</div>
322
323<p>to render a pie chart with this command:</p>
324
325<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert piechart.mvg piechart.png</span></p>
326<p>which produces this rendering:</p>
327
328<p class="image">
329 <a href="../images/piechart.png"><img src="../images/piechart.png" width="624" height="369" alt="piechart" /></a>
330</p>
331
332<p>However, in general, MVG is sufficiently difficult to work with that you probably want to use a program to generate your graphics in the SVG format. ImageMagick automagically converts SVG to MVG and renders your image, for example, we render <a href="../www/source/piechart.svg">piechart.svg</a> with this command:</p>
333
334<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert piechart.svg piechart.jpg</span></p>
335
336<p>to produce the same pie chart we created with the MVG language.</p>
337
338<p>Drawing is available from many of the ImageMagick <a href="../www/api.html">program interfaces</a> as well. ImageMagick converts the drawing API calls to MVG and renders it. Here is example code written in the <a href="../www/magick-wand.html">MagickWand</a> language: </p>
339
340<div class="viewport">
341<pre class="code">
342 (void) PushDrawingWand(draw_wand);
343 {
344 const PointInfo points[6] =
345 {
346 { 180,504 },
347 { 282.7,578.6 },
348 { 243.5,699.4 },
349 { 116.5,699.4 },
350 { 77.26,578.6 },
351 { 180,504 }
352 };
353
354 DrawSetStrokeAntialias(draw_wand,True);
355 DrawSetStrokeWidth(draw_wand,9);
356 DrawSetStrokeLineCap(draw_wand,RoundCap);
357 DrawSetStrokeLineJoin(draw_wand,RoundJoin);
358 (void) DrawSetStrokeDashArray(draw_wand,0,(const double *)NULL);
359 (void) PixelSetColor(color,"#4000c2");
360 DrawSetStrokeColor(draw_wand,color);
361 DrawSetFillRule(draw_wand,EvenOddRule);
362 (void) PixelSetColor(color,"#800000");
363 DrawSetFillColor(draw_wand,color);
364 DrawPolygon(draw_wand,6,points);
365 }
366 (void) PopDrawingWand(draw_wand);
367</pre>
368</div>
369
370</div>
371
372<h2><a name="overview"></a>MVG Overview</h2>
373<div class="doc-section">
374
375<p>MVG ignores all white-space between commands. This allows multiple MVG commands per line. It is common convention to terminate each MVG command with a new line to make MVG easier to edit and read. This syntax description uses indentation in MVG sequences to aid with understanding. Indentation is supported but is not required.</p>
376
377<p>Metafile wrapper syntax (to support stand-alone MVG files):</p>
378
379<pre class="text">
380 push graphic-context
381 viewbox 0 0 width height
382 [ any other MVG commands ]
383 pop graphic-context
384</pre>
385
386<p>Pattern syntax (saving and restoring context):</p>
387
388<pre class="text">
389 push pattern id x,y width,height
390 push graphic-context
391 [ drawing commands ]
392 pop graphic-context
393 pop pattern
394</pre>
395
396<p>an example is (%s is a identifier string):</p>
397
398<pre class="text">
399 push defs
400 push pattern %s 10,10 20,20
401 push graphic-context
402 fill red
403 rectangle 5,5 15,15
404 pop graphic-context
405 push graphic-context
406 fill green
407 rectangle 10,10 20,20
408 pop graphic-context
409 pop pattern
410 pop defs
411</pre>
412
413<p>For image tiling use:</p>
414
415<pre class="text">
416 push pattern id x,y width,height
417 image Copy ...
418 pop pattern
419</pre>
420
421<p>Note you can use the pattern for either the fill or stroke like:</p>
422
423<pre class="text">
424 stroke url(#%s)
425</pre>
426
427<p>or</p>
428
429<pre class="text">
430 fill url(#%s)
431</pre>
432
433<p>The clip path defines a clipping area, where only the contained area to be drawn upon. Areas outside of the clipping areare masked.</p>
434
435<pre class="text">
436 push defs
437 push clip-path %s
438 push graphic-context
439 rectangle 10,10 20,20
440 pop graphic-context
441 pop clip-path
442 pop defs
443 clip-path url(#%s)
444</pre>
445
446</div>
447
448<h2><a name="primitives"></a>Drawing Primitives</h2>
449<div class="doc-section">
450
451<p>Here is a complete description of the MVG drawing primitives:</p>
452
453<dl class="doc">
454
455 <dt class="doc"><a name="affine" id="affine"></a>affine <em class="option">s<sub>x</sub></em>,<em class="option">r<sub>x</sub></em>,<em class="option">r<sub>y</sub></em>,<em class="option">s<sub>y</sub></em>,<em class="option">t<sub>x</sub></em>,<em class="option">t<sub>y</sub></em></dt>
456
457 <dd></dd>
458
459
460
461 <dt class="doc"><a name="arc" id="arc"></a>arc <em class="option">x<sub>0</sub></em>,<em class="option">y<sub>0</sub></em>&nbsp; &nbsp;<em class="option">x<sub>1</sub></em>,<em class="option">y<sub>1</sub></em>&nbsp; &nbsp;<em class="option">a<sub>0</sub></em>,<em class="option">a<sub>1</sub></em></dt>
462
463 <dd></dd>
464
465 <dt class="doc"><a name="bezier" id="bezier"></a>bezier <em class="option">x<sub>0</sub></em>,<em class="option">y<sub>0</sub></em> ... <em class="option">x<sub>n</sub></em>,<em class="option">y<sub>n</sub></em></dt>
466
467 <dd>
468 <p><kbd>Bezier</kbd> (spline) requires three or more x,y coordinates to define its shape. The first and last points are the knots (preserved coordinates) and any intermediate coordinates are the control points. If two control points are specified, the line between each end knot and its sequentially respective control point determines the tangent direction of the curve at that end. If one control point is specified, the lines from the end knots to the one control point determines the tangent directions of the curve at each end. If more than two control points are specified, then the additional control points act in combination to determine the intermediate shape of the curve. In order to
469 draw complex curves, it is highly recommended either to use the <kbd>Path</kbd> primitive or to draw multiple four-point bezier segments with the start and end knots of each successive segment repeated.</p>
470 </dd>
471
472 <dt class="doc"><a name="border-color" id="border-color"></a>border-color <em class="option">color</em></dt>
473
474 <dd></dd>
475
476 <dt class="doc"><a name="circle" id="circle"></a>circle <em class="option">origin<sub>x</sub></em>,<em class="option">origin<sub>y</sub></em>&nbsp; &nbsp;<em class="option">perimeter<sub>x</sub></em>,<em class="option">perimeter<sub>y</sub></em></dt>
477
478 <dd></dd>
479
480 <dt class="doc"><a name="clip-path" id="clip-path"></a>clip-path url(<em class="option">name</em>)</dt>
481
482 <dd></dd>
483
484 <dt class="doc"><a name="clip-rule" id="clip-rule"></a>clip-rule <em class="option">rule</em></dt>
485
486 <dd>Choose from these rule types:
487
488 <p class="text">
489 evenodd <br/>
490 nonzero
491 </p>
492 </dd>
493
494 <dt class="doc"><a name="clip-units" id="clip-units"></a>clip-units <em class="option">units</em></dt>
495
496 <dd>Choose from these unit types:
497
498 <p class="text">
499 userSpace <br/>
500 userSpaceOnUse <br/>
501 objectBoundingBox <br/>
502 </p>
503 </dd>
504
505 <dt class="doc"><a name="color" id="color"></a>color <em class="option">x</em>,<em class="option">y</em> <em class="option">method</em></dt>
506
507
508
509
510
511
512
513
514
515
516
517<dd>Choose from these method types:
518
519<pre class="text">
520 point
521 replace
522 floodfill
523 filltoborder
524 reset
525</pre>
526
527</dd>
528
529 <dt class="doc"><a name="decorate" id="decorate"></a>decorate <em class="option">type</em></dt>
530
531
532<dd>Choose from these types of decorations:
533
534<pre class="text">
535 none
536 line-through
537 overline
538 underline
539</pre>
540
541</dd>
542
543 <dt class="doc"><a name="ellipse" id="ellipse"></a>ellipse <em class="option">center<sub>x</sub></em>,<em class="option">center<sub>y</sub></em>&nbsp; &nbsp;<em class="option">radius<sub>x</sub></em>,<em class="option">radius<sub>y</sub></em>&nbsp; &nbsp;<em class="option">arc<sub>start</sub></em>,<em class="option">arc<sub>stop</sub></em></dt>
544
545 <dt class="doc"><a name="fill" id="fill"></a>fill <em class="option">color</em></dt>
546
547<dd>Choose from any of these <a href="../www/color.html">colors</a>.
548</dd>
549
550 <dt class="doc"><a name="fill-opacity" id="fill-opacity"></a>fill-opacity <em class="option">opacity</em></dt>
551
552
553<dd>The opacity ranges from 0.0 (fully transparent) to 1.0 (fully opaque) or as a percentage (e.g. 50%).
554</dd>
555
556 <dt class="doc"><a name="fill-rule" id="fill-rule"></a>fill-rule <em class="option">rule</em></dt>
557
558
559<dd>Choose from these rule types:
560
561<pre class="text">
562 evenodd
563 nonzero
564</pre>
565
566</dd>
567
568 <dt class="doc"><a name="font" id="font"></a>font <em class="option">name</em></dt>
569
570<dd></dd>
571
572 <dt class="doc"><a name="font-family" id="font-family"></a>font-family <em class="option">family</em></dt>
573
574<dd></dd>
575
576 <dt class="doc"><a name="font-size" id="font-size"></a>font-size <em class="option">point-size</em></dt>
577
578<dd></dd>
579
580 <dt class="doc"><a name="font-stretch" id="font-stretch"></a>font-stretch <em class="option">type</em></dt>
581
582<dd>Choose from these stretch types:
583
584<pre class="text">
585 all
586 normal
587 ultra-condensed
588 extra-condensed
589 condensed
590 semi-condensed
591 semi-expanded
592 expanded
593 extra-expanded
594 ultra-expanded
595</pre>
596
597</dd>
598
599 <dt class="doc"><a name="font-style" id="font-style"></a>font-style <em class="option">style</em></dt>
600
601
602<dd>Choose from these styles:
603
604<pre class="text">
605 all
606 normal
607 italic
608 oblique
609</pre>
610
611</dd>
612
613 <dt class="doc"><a name="font-weight" id="font-weight"></a>font-weight <em class="option">weight</em></dt>
614
615<dd>Choose from these weights:
616
617<pre class="text">
618 all
619 normal
620 bold
621 100
622 200
623 300
624 400
625 500
626 600
627 700
628 800
629 900
630</pre>
631
632</dd>
633
634 <dt class="doc"><a name="gradient-units" id="gradient-units"></a>gradient-units <em class="option">units</em></dt>
635
636<dd>Choose from these units:
637
638<pre class="text">
639 userSpace
640 userSpaceOnUse
641 objectBoundingBox
642</pre>
643
644</dd>
645
646 <dt class="doc"><a name="gravity" id="gravity"></a>gravity <em class="option">type</em></dt>
647
648<dd>Choose from these gravity types:
649
650<pre class="text">
651 NorthWest
652 North
653 NorthEast
654 West
655 Center
656 East
657 SouthWest
658 South
659 SouthEast
660</pre>
661
662</dd>
663
664 <dt class="doc"><a name="image" id="image"></a>image <em class="option">compose x,y width,height 'filename'</em></dt>
665
666<dd>Choose from these compose operations:
667
668<table id="table" cellpadding="2" cellspacing="0" style="width: 93%">
669 <tbody>
670 <tr valign="top">
671 <th align="left" style="width: 8%">Method</th>
672 <th align="left">Description</th>
673 </tr>
674
675 <tr valign="top">
676 <td valign="top">clear</td>
677 <td valign="top">Both the color and the alpha of the destination are cleared. Neither the source nor the destination are used as input.</td>
678 </tr>
679
680 <tr valign="top">
681 <td valign="top">src</td>
682 <td valign="top">The source is copied to the destination. The destination is not used as input.</td>
683 </tr>
684
685 <tr valign="top">
686 <td valign="top">dst</td>
687 <td valign="top">The destination is left untouched.</td>
688 </tr>
689
690 <tr valign="top">
691 <td valign="top"><b>src-over</b></td>
692 <td valign="top">The source is composited over the destination.</td>
693 </tr>
694
695 <tr valign="top">
696 <td valign="top">dst-over</td>
697 <td valign="top">The destination is composited over the source and the result replaces the destination.</td>
698 </tr>
699
700 <tr valign="top">
701 <td valign="top">src-in</td>
702 <td valign="top">The part of the source lying inside of the destination replaces the destination.</td>
703 </tr>
704
705 <tr valign="top">
706 <td valign="top">dst-in</td>
707 <td valign="top">The part of the destination lying inside of the source replaces the destination.</td>
708 </tr>
709
710 <tr valign="top">
711 <td valign="top">src-out</td>
712 <td valign="top">The part of the source lying outside of the destination replaces the destination.</td>
713 </tr>
714
715 <tr valign="top">
716 <td valign="top">dst-out</td>
717 <td valign="top">The part of the destination lying outside of the source replaces the destination.</td>
718 </tr>
719
720 <tr valign="top">
721 <td valign="top">src-atop</td>
722 <td valign="top">The part of the source lying inside of the destination is composited onto the destination.</td>
723 </tr>
724
725 <tr valign="top">
726 <td valign="top">dst-atop</td>
727 <td valign="top">The part of the destination lying inside of the source is composited over the source and replaces the destination.</td>
728 </tr>
729
730 <tr valign="top">
731 <td valign="top">multiply</td>
732 <td valign="top">The source is multiplied by the destination and replaces the destination. The resultant color is always at least as dark as either of the two constituent colors. Multiplying any color with black produces black. Multiplying any color with white leaves the original color unchanged.</td>
733 </tr>
734
735 <tr valign="top">
736 <td valign="top">screen</td>
737 <td valign="top">The source and destination are complemented and then multiplied and then replace the destination. The resultant color is always at least as light as either of the two constituent colors. Screening any color with white produces white. Screening any color with black leaves the original color unchanged.</td>
738 </tr>
739
740 <tr valign="top">
741 <td valign="top">overlay</td>
742 <td valign="top">Multiplies or screens the colors, dependent on the destination color. Source colors overlay the destination whilst preserving its highlights and shadows. The destination color is not replaced, but is mixed with the source color to reflect the lightness or darkness of the destination.</td>
743 </tr>
744
745 <tr valign="top">
746 <td valign="top">darken</td>
747 <td valign="top">Selects the darker of the destination and source colors. The destination is replaced with the source when the source is darker, otherwise it is left unchanged.</td>
748 </tr>
749
750 <tr valign="top">
751 <td valign="top">lighten</td>
752 <td valign="top">Selects the lighter of the destination and source colors. The destination is replaced with the source when the source is lighter, otherwise it is left unchanged.</td>
753 </tr>
754
755 <tr valign="top">
756 <td valign="top">linear-light</td>
757 <td valign="top">Increase contrast slightly with an impact on the foreground's tonal values.</td>
758 </tr>
759
760 <tr valign="top">
761 <td valign="top">color-dodge</td>
762 <td valign="top">Brightens the destination color to reflect the source color. Painting with black produces no change.</td>
763 </tr>
764
765 <tr valign="top">
766 <td valign="top">color-burn</td>
767 <td valign="top">Darkens the destination color to reflect the source color. Painting with white produces no change.</td>
768 </tr>
769
770 <tr valign="top">
771 <td valign="top">hard-light</td>
772 <td valign="top">Multiplies or screens the colors, dependent on the source color value. If the source color is lighter than 0.5, the destination is lightened as if it were screened. If the source color is darker than 0.5, the destination is darkened, as if it were multiplied. The degree of lightening or darkening is proportional to the difference between the source color and 0.5. If it is equal to 0.5 the destination is unchanged. Painting with pure black or white produces black or white.</td>
773 </tr>
774
775 <tr valign="top">
776 <td valign="top">soft-light</td>
777 <td valign="top">Darkens or lightens the colors, dependent on the source color value. If the source color is lighter than 0.5, the destination is lightened. If the source color is darker than 0.5, the destination is darkened, as if it were burned in. The degree of darkening or lightening is proportional to the difference between the source color and 0.5. If it is equal to 0.5, the destination is unchanged. Painting with pure black or white produces a distinctly darker or lighter area, but does not result in pure black or white.</td>
778 </tr>
779
780 <tr valign="top">
781 <td valign="top">plus</td>
782 <td valign="top">The source is added to the destination and replaces the destination. This operator is useful for animating a dissolve between two images.</td>
783 </tr>
784
785 <tr valign="top">
786 <td valign="top">add</td>
787 <td valign="top">As per 'plus' but transparency data is treated as matte
788 values. As such any transparent areas in either image remain
789 transparent. </td>
790 </tr>
791
792 <tr valign="top">
793 <td valign="top">minus</td>
794 <td valign="top">Subtract the colors in the source image from the
795 destination image. When transparency is involved, Opaque areas will be
796 subtracted from any destination opaque areas. </td>
797 </tr>
798
799 <tr valign="top">
800 <td valign="top">subtract</td>
801 <td valign="top">Subtract the colors in the source image from the
802 destination image. When transparency is involved transparent areas are
803 subtracted, so only the opaque areas in the source remain opaque in
804 the destination image. </td>
805 </tr>
806
807 <tr valign="top">
808 <td valign="top">difference</td>
809 <td valign="top">Subtracts the darker of the two constituent colors from the lighter. Painting with white inverts the destination color. Painting with black produces no change.</td>
810 </tr>
811
812 <tr valign="top">
813 <td valign="top">exclusion</td>
814 <td valign="top">Produces an effect similar to that of 'difference', but appears as lower contrast. Painting with white inverts the destination color. Painting with black produces no change.</td>
815 </tr>
816
817 <tr valign="top">
818 <td valign="top">xor</td>
819 <td valign="top">The part of the source that lies outside of the destination is combined with the part of the destination that lies outside of the source.</td>
820 </tr>
821
822 <tr valign="top">
823 <td valign="top">copy-*</td>
824 <td valign="top">Copy the specificed channel in the source image to the
825 same channel in the destination image. If the channel specified in
826 the source image does not exist, (which can only happen for methods,
827 '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is
828 assumed that the source image is a special grayscale channel image
829 of the values to be copied. </td>
830 </tr>
831
832 <tr valign="top">
833 <td valign="top">change-mask</td>
834 <td valign="top">Replace any destination pixel that is the similar to the source images pixel (as defined by the current <a href="#fuzz">-fuzz</a> factor), with transparency. </td>
835 </tr>
836 </tbody>
837</table>
838
839</dd>
840
841 <dt class="doc"><a name="interword-spacing" id="interword-spacing"></a>interword-spacing <em class="option">pixels</em></dt>
842
843 <dd></dd>
844
845 <dt class="doc"><a name="kerning" id="kerning"></a>kerning <em class="option">pixels</em></dt>
846
847 <dd></dd>
848
849 <dt class="doc"><a name="line" id="line"></a>line <em class="option">x,y x<sub>1</sub>,y<sub>1</sub></em></dt>
850
851 <dd></dd>
852
853 <dt class="doc"><a name="matte" id="matte"></a>matte <em class="option">x,y method</em></dt>
854
855<dd>Choose from these methods:
856
857<pre class="text">
858 point
859 replace
860 floodfill
861 filltoborder
862 reset
863</pre>
864
865</dd>
866
867 <dt class="doc"><a name="offset" id="offset"></a>offset <em class="option">offset</em></dt>
868
869 <dd></dd>
870
871 <dt class="doc"><a name="opacity" id="opacity"></a>opacity <em class="option">opacity</em></dt>
872
873<dd>Use percent (e.g. 50%).</dd>
874
875 <dt class="doc"><a name="path" id="path"></a>path <em class="option">path</em></dt>
876
877 <dd></dd>
878
879 <dt class="doc"><a name="point" id="point"></a>point <em class="option">x,y</em></dt>
880
881 <dd></dd>
882
883 <dt class="doc"><a name="polygon" id="polygon"></a>polygon <em class="option">x,y x<sub>1</sub>,y<sub>1</sub>, ..., x<sub>n</sub>,y<sub>n</sub></em></dt>
884
885 <dd></dd>
886
887 <dt class="doc"><a name="polyline" id="polyline"></a>polyline <em class="option">x,y x<sub>1</sub>,y<sub>1</sub>, ..., x<sub>n</sub>,y<sub>n</sub></em></dt>
888
889 <dd></dd>
890
891 <dt class="doc"><a name="pop-clip-path" id="pop-clip-path"></a>pop clip-path</dt>
892
893 <dd></dd>
894
895 <dt class="doc"><a name="pop-defs" id="pop-defs"></a>pop defs</dt>
896
897 <dd></dd>
898
899 <dt class="doc"><a name="pop-gradient" id="pop-gradient"></a>pop gradient</dt>
900
901 <dd></dd>
902
903 <dt class="doc"><a name="pop-graphic-context" id="pop-graphic-context"></a>pop graphic-context</dt>
904
905 <dd></dd>
906
907 <dt class="doc"><a name="pop-pattern" id="pop-pattern"></a>pop pattern</dt>
908
909 <dd></dd>
910
911 <dt class="doc"><a name="push" id="push"></a>push clip-path <em class="option">name</em></dt>
912
913 <dd></dd>
914
915 <dt class="doc"><a name="push-defs" id="push-defs"></a>push defs</dt>
916
917 <dd></dd>
918
919 <dt class="doc"><a name="push-gradient-linear" id="push-gradient-linear"></a>push gradient <em class="option">id linear x,y x<sub>1</sub>,y<sub>1</sub></em></dt>
920
921 <dd></dd>
922
923 <dt class="doc"><a name="push-gradient-radial" id="push-gradient-radial"></a>push gradient <em class="option">id radial x<sub>c</sub>,c<sub>y</sub> x<sub>f</sub>,y<sub>f</sub> radius</em></dt>
924
925 <dd></dd>
926
927 <dt class="doc"><a name="push-graphic-context" id="push-graphic-context"></a>push graphic-context</dt>
928
929 <dd></dd>
930
931 <dt class="doc"><a name="push-pattern" id="push-pattern"></a>push pattern <em class="option">id radial x,y width,height</em></dt>
932
933 <dd></dd>
934
935 <dt class="doc"><a name="rectangle" id="rectangle"></a>rectangle <em class="option">x,y x<sub>1</sub>,y<sub>1</sub></em></dt>
936
937 <dd></dd>
938
939 <dt class="doc"><a name="rotate" id="rotate"></a>rotate <em class="option">angle</em></dt>
940
941 <dd></dd>
942
943 <dt class="doc"><a name="roundrectangle" id="roundrectangle"></a>roundrectangle <em class="option">x,y x<sub>1</sub>,y<sub>1</sub> width,height</em></dt>
944
945 <dd></dd>
946
947 <dt class="doc"><a name="scale" id="scale"></a>scale <em class="option">x,y</em></dt>
948
949 <dd></dd>
950
951 <dt class="doc"><a name="skewX" id="skewX"></a>skewX <em class="option">angle</em></dt>
952
953 <dd></dd>
954
955 <dt class="doc"><a name="skewY" id="skewY"></a>skewX <em class="option">angle</em></dt>
956
957 <dd></dd>
958
959 <dt class="doc"><a name="stop-color" id="stop-color"></a>stop-color <em class="option">color offset</em></dt>
960
961 <dd></dd>
962
963 <dt class="doc"><a name="stroke" id="stroke"></a>stroke <em class="option">color</em></dt>
964
965 <dd></dd>
966
967 <dt class="doc"><a name="stroke-antialias" id="stroke-antialias"></a>stroke-antialias <em class="option">0 &bull; 1</em></dt>
968
969 <dd></dd>
970
971 <dt class="doc"><a name="stroke-dasharray" id="stroke-dasharray"></a>stroke-dasharray <em class="option">none &bull; numeric-list</em></dt>
972
973 <dd></dd>
974
975 <dt class="doc"><a name="stroke-dashoffset" id="stroke-dashoffset"></a>stroke-dashoffset <em class="option">offset</em></dt>
976
977 <dd></dd>
978
979 <dt class="doc"><a name="stroke-linecap" id="stroke-linecap"></a>stroke-linecap <em class="option">type</em></dt>
980
981
982 <dd>Choose from these cap types:
983
984<pre class="text">
985 butt
986 round
987 square
988</pre>
989
990 </dd>
991
992 <dt class="doc"><a name="stroke-linejoin" id="stroke-linejoin"></a>stroke-linejoin <em class="option">type</em></dt>
993
994 <dd>Choose from these join types:
995
996<pre class="text">
997 bevel
998 miter
999 round
1000</pre>
1001
1002 </dd>
1003
1004 <dt class="doc"><a name="stroke-miterlimit" id="stroke-miterlimit"></a>stroke-miterlimit <em class="option">limit</em></dt>
1005
1006 <dd></dd>
1007
1008 <dt class="doc"><a name="stroke-opacity" id="stroke-opacity"></a>stroke-opacity <em class="option">opacity</em></dt>
1009
1010 <dd>The opacity ranges from 0.0 (fully transparent) to 1.0 (fully opaque) or as a percentage (e.g. 50%).
1011 </dd>
1012
1013 <dt class="doc"><a name="stroke-width" id="stroke-width"></a>stroke-width <em class="option">width</em></dt>
1014
1015 <dd></dd>
1016
1017 <dt class="doc"><a name="text" id="text"></a>text <em class="option">"text"</em></dt>
1018
1019 <dd></dd>
1020
1021 <dt class="doc"><a name="text-antialias" id="text-antialias"></a>text-antialias <em class="option">0 &bull; 1</em></dt>
1022
1023 <dd></dd>
1024
1025 <dt class="doc"><a name="text-undercolor" id="text-undercolor"></a>text-undercolor <em class="option">color</em></dt>
1026
1027 <dd></dd>
1028
1029 <dt class="doc"><a name="translate" id="translate"></a>translate <em class="option">x,y</em></dt>
1030
1031 <dd></dd>
1032
1033 <dt class="doc"><a name="viewbox" id="viewbox"></a>viewbox <em class="option">x,y x<sub>1</sub>,y<sub>1</sub></em></dt>
1034
1035 <dd></dd>
1036
1037</dl>
1038
1039</div>
1040
1041
1042
1043</div>
1044
1045<div id="linkbar">
1046 <!-- <span id="linkbar-west">&nbsp;</span> -->
1047 <span id="linkbar-center">
1048 <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;
1049 <a href="../www/mailing-list.html">Mailing Lists</a> &bull;
1050 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
1051 </span>
1052 <span id="linkbar-east">&nbsp;</span>
1053 </div>
1054 <div class="footer">
1055 <span id="footer-west">&copy; 1999-2009 ImageMagick Studio LLC</span>
1056 <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
1057 </div>
1058 <div style="clear: both; margin: 0; width: 100%; "></div>
1059</body>
1060</html>