]> granicus.if.org Git - imagemagick/blob - www/magick-vector-graphics.html
(no commit message)
[imagemagick] / www / magick-vector-graphics.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">\r
4 <head>\r
5   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\r
6   <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U="/>\r
7   <title>ImageMagick: Magick Vector Graphics</title/>
8   <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, 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."/>
13   <meta name="Application-url" content="http://www.imagemagick.org"/>
14   <meta name="Generator" content="PHP"/>
15   <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"/>
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-2010 ImageMagick Studio LLC"/>
23   <meta name="Distribution" content="Global"/>
24   <link rel="icon" href="../images/wand.png"  sizes="32x32"/>
25   <link rel="shortcut icon" href="../images/wand.ico"  type="images/x-icon"/>
26   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>\r
27   <style type="text/css" media="all">\r
28     @import url("../www/magick.css");\r
29   </style>\r
30 </head>\r
31 \r
32 <body id="www-imagemagick-org">\r
33 <div class="titlebar">\r
34 <a href="../index.html">\r
35   <img src="../images/script.png" alt="[ImageMagick]"\r
36   style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>\r
37 <a href="http://www.networkredux.com">\r
38   <img src="../images/networkredux.png" alt="[sponsor]"\r
39   style="margin: 45px auto; border: 0px; float: left;" /></a>\r
40 <a href="http://www.imagemagick.org/discourse-server/">\r
41   <img src="../images/logo.jpg" alt=""\r
42   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>\r
43 <a href="../index.html">\r
44   <img src="../images/sprite.jpg" alt=""\r
45   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>\r
46 </div>\r
47 \r
48 <div class="westbar">\r
49 \r
50 <div class="menu">
51   <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
52 </div>
53 <div class="sep"></div>\r
54 <div class="menu">
55   <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a>
56 </div>
57 <div class="sub">
58     <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a>
59 </div>
60 <div class="sub">
61     <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
62 </div>
63 <div class="sub">
64     <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
65 </div>
66 <div class="sep"></div>\r
67 <div class="menu">
68   <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a>
69 </div>
70 <div class="sub">
71     <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a>
72 </div>
73 <div class="sub">
74     <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a>
75 </div>
76 <div class="sub">
77     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
78 </div>
79 <div class="menu">
80   <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a>
81 </div>
82 <div class="sub">
83     <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a>
84 </div>
85 <div class="sub">
86     <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a>
87 </div>
88 <div class="sub">
89     <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a>
90 </div>
91 <div class="sub">
92     <a title="Program Interface: Magick++" href="../Magick++/">Magick++</a>
93 </div>
94 <div class="sep"></div>\r
95 <div  class="menu">
96    <a title="Install from Source" href="../www/install-source.html">Install from Source</a>
97 </div>
98 <div class="sub">
99     <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a>
100 </div>
101 <div class="sub">
102     <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a>
103  </div>
104 <div class="menu">
105   <a title="Resources" href="../www/resources.html">Resources</a>
106 </div>
107 <div class="menu">
108   <a title="Architecture" href="../www/architecture.html">Architecture</a>
109 </div>
110 <div class="menu">
111   <a title="Download" href="../www/download.html">Download</a>
112 </div>
113 <div class="sep"></div>\r
114 <div class="menu">
115   <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
116 </div>
117 <div class="sep"></div>\r
118 <div class="menu">
119   <a title="Site Map"href="../www/sitemap.html">Site Map</a>
120 </div>
121 <div  class="sub">
122     <a title="Site Map: Links"href="../www/links.html">Links</a>
123 </div>
124 <div class="sep"></div>\r
125 <div  class="menu">
126   <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
127
128 <div class="sponsbox">
129 <div  class="sponsor">
130    <a title="Sponsor: Atlas Multimedia" href="http://www.atlas-multimedia.de/">Atlas Multimedia</a><!-- 20101201000025 tanju.temurbas-->
131 </div>
132 <div  class="sponsor">
133   <a title="Sponsor: Image Converter" href="http://www.batchphoto.com">Image Converter</a><!-- 201103010900 Bits Coffee-->
134 </div>
135 <div  class="sponsor">
136   <a title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
137 </div>
138 <div  class="sponsor">
139   <a title="Sponsor: Webdesign Agentur" href="http://www.ventzke-partner.de">Webdesign Agentur</a><!-- 201101010480 invendio.de-->
140 </div>
141 <div  class="sponsor">
142   <a title="Sponsor: LVM Versicherung" href="http://www.neu-reich.de">LVM Versicherung</a><!-- 201101010480 -->
143 </div>
144 <div  class="sponsor">
145   <a title="Sponsor: Diamonds are a Girls Best Friend" href="http://www.schmuck.org">Diamonds are a Girls Best Friend</a><!-- 201101010600 Peterssen-->
146 </div>
147 <div  class="sponsor">
148    <a title="Sponsor: Druckerei Online" href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012011200 allesdruck.de-->
149 </div>
150 </div>
151 </div>
152 </div>\r
153 \r
154 <div class="eastbar">\r
155   <script type="text/javascript">\r
156   <!--\r
157     google_ad_client = "pub-3129977114552745";\r
158     google_ad_slot = "0574824969";\r
159     google_ad_width = 160;\r
160     google_ad_height = 600;\r
161   //-->\r
162   </script>\r
163   <script type="text/javascript"\r
164     src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
165   </script>\r
166 </div>\r
167 \r
168 <div class="main">\r
169 \r
170 \r
171 <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>
172
173 <h2><a name="intro"></a>Introduction to Vector Graphics</h2>
174 <div class="doc-section">
175
176 <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
177 command 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>
178
179 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert -size 100x60 xc:skyblue -fill white -stroke black \  <br/>
180     -draw "path 'M 30,40  A 30,20  20  0,0 70,20 A 30,20  20  1,0 30,40 Z '" \ <br/>
181     arc.png</span></p>
182 <p>and here is the result:</p>
183
184 <p class="image">
185   <a href="../images/arc.png"><img src="../images/arc.png" width="100" height="60" alt="arc" /></a>
186 </p>
187
188 <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>
189
190 <div class="viewport">
191 <pre class="code">
192   push graphic-context
193     viewbox 0 0 624 369
194     affine 0.283636 0 0 0.283846 -0 -0
195     push graphic-context
196       push graphic-context
197         fill 'darkslateblue'
198         stroke 'blue'
199         stroke-width 1
200         rectangle 1,1 2199,1299
201       pop graphic-context
202       push graphic-context
203         font-size 40
204         fill 'white'
205         stroke-width 1
206         text 600,1100 'Average: 20.0'
207       pop graphic-context
208       push graphic-context
209         fill 'red'
210         stroke 'black'
211         stroke-width 5
212         path 'M700.0,600.0 L340.0,600.0 A360.0,360.0 0 0,1 408.1452123287954,389.2376150414973 z'
213       pop graphic-context
214       push graphic-context
215         font-size 40
216         fill 'white'
217         stroke-width 1
218         text 1400,140 'MagickWand for PHP'
219       pop graphic-context
220       push graphic-context
221         font-size 30
222         fill 'white'
223         stroke-width 1
224         text 1800,140 '(10.0%)'
225       pop graphic-context
226       push graphic-context
227         fill 'red'
228         stroke 'black'
229         stroke-width 4
230         rectangle 1330,100 1370,140
231       pop graphic-context
232       push graphic-context
233         fill 'yellow'
234         stroke 'black'
235         stroke-width 5
236         path 'M700.0,600.0 L408.1452123287954,389.2376150414973 A360.0,360.0 0 0,1 976.5894480359858,369.56936567559273 z'
237       pop graphic-context
238       push graphic-context
239         font-size 40
240         fill 'white'
241         stroke-width 1
242         text 1400,220 'MagickCore'
243       pop graphic-context
244       push graphic-context
245         font-size 30
246         fill 'white'
247         stroke-width 1
248         text 1800,220 '(29.0%)'
249       pop graphic-context
250       push graphic-context
251         fill 'yellow'
252         stroke 'black'
253         stroke-width 4
254         rectangle 1330,180 1370,220
255       pop graphic-context
256       push graphic-context
257         fill 'fuchsia'
258         stroke 'black'
259         stroke-width 5
260         path 'M700.0,600.0 L976.5894480359858,369.56936567559273 A360.0,360.0 0 0,1 964.2680466142854,844.4634932636567 z'
261       pop graphic-context
262       push graphic-context
263         font-size 40
264         fill 'white'
265         stroke-width 1
266         text 1400,300 'MagickWand'
267       pop graphic-context
268       push graphic-context
269         font-size 30
270         fill 'white'
271         stroke-width 1
272         text 1800,300 '(22.9%)'
273       pop graphic-context
274       push graphic-context
275         fill 'fuchsia'
276         stroke 'black'
277         stroke-width 4
278         rectangle 1330,260 1370,300
279       pop graphic-context
280       push graphic-context
281         fill 'blue'
282         stroke 'black'
283         stroke-width 5
284         path 'M700.0,600.0 L964.2680466142854,844.4634932636567 A360.0,360.0 0 0,1 757.853099990584,955.3210081341651 z'
285       pop graphic-context
286       push graphic-context
287         font-size 40
288         fill 'white'
289         stroke-width 1
290         text 1400,380 'JMagick'
291       pop graphic-context
292       push graphic-context
293         font-size 30
294         fill 'white'
295         stroke-width 1
296         text 1800,380 '(10.6%)'
297       pop graphic-context
298       push graphic-context
299         fill 'blue'
300         stroke 'black'
301         stroke-width 4
302         rectangle 1330,340 1370,380
303       pop graphic-context
304       push graphic-context
305         fill 'lime'
306         stroke 'black'
307         stroke-width 5
308         path 'M700.0,600.0 L757.853099990584,955.3210081341651 A360.0,360.0 0 0,1 340.0,600.0 z'
309       pop graphic-context
310       push graphic-context
311         font-size 40
312         fill 'white'
313         stroke-width 1
314         text 1400,460 'Magick++'
315       pop graphic-context
316       push graphic-context
317         font-size 30
318         fill 'white'
319         stroke-width 1
320         text 1800,460 '(27.5%)'
321       pop graphic-context
322       push graphic-context
323         fill 'lime'
324         stroke 'black'
325         stroke-width 4
326         rectangle 1330,420 1370,460
327       pop graphic-context
328       push graphic-context
329         font-size 100
330         fill 'white'
331         stroke-width 1
332         text 100,150 'ImageMagick'
333       pop graphic-context
334       push graphic-context
335         fill 'none'
336         stroke 'black'
337         stroke-width 5
338         circle 700,600 700,960
339       pop graphic-context
340     pop graphic-context
341   pop graphic-context
342 </pre>
343 </div>
344
345 <p>to render a pie chart with this command:</p>
346
347 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert piechart.mvg piechart.png</span></p>
348 <p>which produces this rendering:</p>
349
350 <p class="image">
351   <a href="../images/piechart.png"><img src="../images/piechart.png" width="624" height="369" alt="piechart" /></a>
352 </p>
353
354 <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>
355
356 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert piechart.svg piechart.jpg</span></p>
357
358 <p>to produce the same pie chart we created with the MVG language.</p>
359
360 <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>
361
362 <div class="viewport">
363 <pre class="code">
364    (void) PushDrawingWand(draw_wand);
365    {
366      const PointInfo points[6] =
367      {
368        { 180,504 },
369        { 282.7,578.6 },
370        { 243.5,699.4 },
371        { 116.5,699.4 },
372        { 77.26,578.6 },
373        { 180,504 }
374      };
375
376      DrawSetStrokeAntialias(draw_wand,True);
377      DrawSetStrokeWidth(draw_wand,9);
378      DrawSetStrokeLineCap(draw_wand,RoundCap);
379      DrawSetStrokeLineJoin(draw_wand,RoundJoin);
380      (void) DrawSetStrokeDashArray(draw_wand,0,(const double *)NULL);
381      (void) PixelSetColor(color,"#4000c2");
382      DrawSetStrokeColor(draw_wand,color);
383      DrawSetFillRule(draw_wand,EvenOddRule);
384      (void) PixelSetColor(color,"#800000");
385      DrawSetFillColor(draw_wand,color);
386      DrawPolygon(draw_wand,6,points);
387    }
388    (void) PopDrawingWand(draw_wand);
389 </pre>
390 </div>
391
392 </div>
393
394 <h2><a name="overview"></a>MVG Overview</h2>
395 <div class="doc-section">
396
397 <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>
398
399 <p>Metafile wrapper syntax (to support stand-alone MVG files):</p>
400
401 <pre class="text">
402   push graphic-context
403     viewbox 0 0 width height
404     [ any other MVG commands ]
405   pop graphic-context
406 </pre>
407
408 <p>Pattern syntax (saving and restoring context):</p>
409
410 <pre class="text">
411   push pattern id x,y width,height
412    push graphic-context
413     [ drawing commands ]
414    pop graphic-context
415   pop pattern
416 </pre>
417
418 <p>an example is (%s is a identifier string):</p>
419
420 <pre class="text">
421   push defs
422    push pattern %s 10,10 20,20
423     push graphic-context
424      fill red
425      rectangle 5,5 15,15
426     pop graphic-context
427     push graphic-context
428      fill green
429      rectangle 10,10 20,20
430     pop graphic-context
431    pop pattern
432   pop defs
433 </pre>
434
435 <p>For image tiling use:</p>
436
437 <pre class="text">
438   push pattern id x,y width,height
439    image Copy ...
440   pop pattern
441 </pre>
442
443 <p>Note you can use the pattern for either the fill or stroke like:</p>
444
445 <pre class="text">
446   stroke url(#%s)
447 </pre>
448
449 <p>or</p>
450
451 <pre class="text">
452   fill url(#%s)
453 </pre>
454
455 <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>
456
457 <pre class="text">
458   push defs
459    push clip-path %s
460     push graphic-context
461      rectangle 10,10 20,20
462     pop graphic-context
463    pop clip-path
464   pop defs
465   clip-path url(#%s)
466 </pre>
467
468 </div>
469
470 <h2><a name="primitives"></a>Drawing Primitives</h2>
471 <div class="doc-section">
472
473 <p>Here is a complete description of the MVG drawing primitives:</p>
474
475 <dl class="doc">
476
477   <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>
478
479   <dd></dd>
480
481
482
483   <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>
484
485   <dd></dd>
486
487   <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>
488
489   <dd>
490   <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
491   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>
492   </dd>
493
494   <dt class="doc"><a name="border-color" id="border-color"></a>border-color <em class="option">color</em></dt>
495
496   <dd></dd>
497
498   <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>
499
500   <dd></dd>
501
502   <dt class="doc"><a name="clip-path" id="clip-path"></a>clip-path url(<em class="option">name</em>)</dt>
503
504   <dd></dd>
505
506   <dt class="doc"><a name="clip-rule" id="clip-rule"></a>clip-rule <em class="option">rule</em></dt>
507
508   <dd>Choose from these rule types:
509
510         <p class="text">
511           evenodd <br/>
512           nonzero
513         </p>
514    </dd>
515
516   <dt class="doc"><a name="clip-units" id="clip-units"></a>clip-units <em class="option">units</em></dt>
517
518   <dd>Choose from these unit types:
519
520         <p class="text">
521           userSpace <br/>
522           userSpaceOnUse  <br/>
523           objectBoundingBox <br/>
524         </p>
525   </dd>
526
527   <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>
528
529
530
531
532
533
534
535
536
537
538
539 <dd>Choose from these method types:
540
541 <pre class="text">
542   point
543   replace
544   floodfill
545   filltoborder
546   reset
547 </pre>
548
549 </dd>
550
551   <dt class="doc"><a name="decorate" id="decorate"></a>decorate <em class="option">type</em></dt>
552
553
554 <dd>Choose from these types of decorations:
555
556 <pre class="text">
557   none
558   line-through
559   overline
560   underline
561 </pre>
562
563 </dd>
564
565   <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>
566
567   <dt class="doc"><a name="fill" id="fill"></a>fill <em class="option">color</em></dt>
568
569 <dd>Choose from any of these <a href="../www/color.html">colors</a>.
570 </dd>
571
572   <dt class="doc"><a name="fill-opacity" id="fill-opacity"></a>fill-opacity <em class="option">opacity</em></dt>
573
574
575 <dd>The opacity ranges from 0.0 (fully transparent) to 1.0 (fully opaque) or as a percentage (e.g. 50%).
576 </dd>
577
578   <dt class="doc"><a name="fill-rule" id="fill-rule"></a>fill-rule <em class="option">rule</em></dt>
579
580
581 <dd>Choose from these rule types:
582
583 <pre class="text">
584   evenodd
585   nonzero
586 </pre>
587
588 </dd>
589
590   <dt class="doc"><a name="font" id="font"></a>font <em class="option">name</em></dt>
591
592 <dd></dd>
593
594   <dt class="doc"><a name="font-family" id="font-family"></a>font-family <em class="option">family</em></dt>
595
596 <dd></dd>
597
598   <dt class="doc"><a name="font-size" id="font-size"></a>font-size <em class="option">point-size</em></dt>
599
600 <dd></dd>
601
602   <dt class="doc"><a name="font-stretch" id="font-stretch"></a>font-stretch <em class="option">type</em></dt>
603
604 <dd>Choose from these stretch types:
605
606 <pre class="text">
607   all
608   normal
609   ultra-condensed
610   extra-condensed
611   condensed
612   semi-condensed
613   semi-expanded
614   expanded
615   extra-expanded
616   ultra-expanded
617 </pre>
618
619 </dd>
620
621   <dt class="doc"><a name="font-style" id="font-style"></a>font-style <em class="option">style</em></dt>
622
623
624 <dd>Choose from these styles:
625
626 <pre class="text">
627   all
628   normal
629   italic
630   oblique
631 </pre>
632
633 </dd>
634
635   <dt class="doc"><a name="font-weight" id="font-weight"></a>font-weight <em class="option">weight</em></dt>
636
637 <dd>Choose from these weights:
638
639 <pre class="text">
640   all
641   normal
642   bold
643   100
644   200
645   300
646   400
647   500
648   600
649   700
650   800
651   900
652 </pre>
653
654 </dd>
655
656   <dt class="doc"><a name="gradient-units" id="gradient-units"></a>gradient-units <em class="option">units</em></dt>
657
658 <dd>Choose from these units:
659
660 <pre class="text">
661   userSpace
662   userSpaceOnUse
663   objectBoundingBox
664 </pre>
665
666 </dd>
667
668   <dt class="doc"><a name="gravity" id="gravity"></a>gravity <em class="option">type</em></dt>
669
670 <dd>Choose from these gravity types:
671
672 <pre class="text">
673   NorthWest
674   North
675   NorthEast
676   West
677   Center
678   East
679   SouthWest
680   South
681   SouthEast
682 </pre>
683
684 </dd>
685
686   <dt class="doc"><a name="image" id="image"></a>image <em class="option">compose x,y width,height 'filename'</em></dt>
687
688 <dd>Choose from these compose operations:
689
690 <table id="table" cellpadding="2" cellspacing="0" style="width: 93%">
691   <tbody>
692   <tr valign="top">
693     <th align="left" style="width: 8%">Method</th>
694     <th align="left">Description</th>
695   </tr>
696
697   <tr valign="top">
698     <td valign="top">clear</td>
699     <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>
700   </tr>
701
702   <tr valign="top">
703     <td valign="top">src</td>
704     <td valign="top">The source is copied to the destination. The destination is not used as input.</td>
705   </tr>
706
707   <tr valign="top">
708     <td valign="top">dst</td>
709     <td valign="top">The destination is left untouched.</td>
710   </tr>
711
712   <tr valign="top">
713     <td valign="top"><b>src-over</b></td>
714     <td valign="top">The source is composited over the destination.</td>
715   </tr>
716
717   <tr valign="top">
718     <td valign="top">dst-over</td>
719     <td valign="top">The destination is composited over the source and the result replaces the destination.</td>
720   </tr>
721
722   <tr valign="top">
723     <td valign="top">src-in</td>
724     <td valign="top">The part of the source lying inside of the destination replaces the destination.</td>
725   </tr>
726
727   <tr valign="top">
728     <td valign="top">dst-in</td>
729     <td valign="top">The part of the destination lying inside of the source replaces the destination.</td>
730   </tr>
731
732   <tr valign="top">
733     <td valign="top">src-out</td>
734     <td valign="top">The part of the source lying outside of the destination replaces the destination.</td>
735   </tr>
736
737   <tr valign="top">
738     <td valign="top">dst-out</td>
739     <td valign="top">The part of the destination lying outside of the source         replaces the destination.</td>
740   </tr>
741
742   <tr valign="top">
743     <td valign="top">src-atop</td>
744     <td valign="top">The part of the source lying inside of the destination is  composited onto the destination.</td>
745   </tr>
746
747   <tr valign="top">
748     <td valign="top">dst-atop</td>
749     <td valign="top">The part of the destination lying inside of the source is composited over the source and replaces the destination.</td>
750   </tr>
751
752   <tr valign="top">
753     <td valign="top">multiply</td>
754     <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>
755   </tr>
756
757   <tr valign="top">
758     <td valign="top">screen</td>
759     <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>
760   </tr>
761
762   <tr valign="top">
763     <td valign="top">overlay</td>
764     <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>
765   </tr>
766
767   <tr valign="top">
768     <td valign="top">darken</td>
769     <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>
770   </tr>
771
772   <tr valign="top">
773     <td valign="top">lighten</td>
774     <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>
775   </tr>
776
777   <tr valign="top">
778     <td valign="top">linear-light</td>
779     <td valign="top">Increase contrast slightly with an impact on the foreground's tonal values.</td>
780   </tr>
781
782   <tr valign="top">
783     <td valign="top">color-dodge</td>
784     <td valign="top">Brightens the destination color to reflect the source color. Painting with black produces no change.</td>
785   </tr>
786
787   <tr valign="top">
788     <td valign="top">color-burn</td>
789     <td valign="top">Darkens the destination color to reflect the source color.  Painting with white produces no change.</td>
790   </tr>
791
792   <tr valign="top">
793     <td valign="top">hard-light</td>
794     <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>
795   </tr>
796
797   <tr valign="top">
798     <td valign="top">soft-light</td>
799     <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>
800   </tr>
801
802   <tr valign="top">
803     <td valign="top">plus</td>
804     <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>
805   </tr>
806
807   <tr valign="top">
808     <td valign="top">add</td>
809     <td valign="top">As per 'plus' but transparency data is treated as matte
810         values. As such any transparent areas in either image remain
811         transparent. </td>
812   </tr>
813
814   <tr valign="top">
815     <td valign="top">minus</td>
816     <td valign="top">Subtract the colors in the source image from the
817         destination image. When transparency is involved, Opaque areas will be
818         subtracted from any destination opaque areas. </td>
819   </tr>
820
821   <tr valign="top">
822     <td valign="top">subtract</td>
823     <td valign="top">Subtract the colors in the source image from the
824         destination image. When transparency is involved transparent areas are
825         subtracted, so only the opaque areas in the source remain opaque in
826         the destination image. </td>
827   </tr>
828
829   <tr valign="top">
830     <td valign="top">difference</td>
831     <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>
832   </tr>
833
834   <tr valign="top">
835     <td valign="top">exclusion</td>
836     <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>
837   </tr>
838
839   <tr valign="top">
840     <td valign="top">xor</td>
841     <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>
842   </tr>
843
844   <tr valign="top">
845     <td valign="top">copy-*</td>
846     <td valign="top">Copy the specificed channel in the source image to the
847         same channel in the destination image.  If the channel specified in
848         the source image does not exist, (which can only happen for methods,
849         '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is
850         assumed that the source image is a special grayscale channel image
851         of the values to be copied. </td>
852     </tr>
853
854   <tr valign="top">
855     <td valign="top">change-mask</td>
856     <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>
857   </tr>
858   </tbody>
859 </table>
860
861 </dd>
862
863   <dt class="doc"><a name="interline-spacing" id="interline-spacing"></a>interline-spacing <em class="option">pixels</em></dt>
864
865   <dd></dd>
866
867   <dt class="doc"><a name="interword-spacing" id="interword-spacing"></a>interword-spacing <em class="option">pixels</em></dt>
868
869   <dd></dd>
870
871   <dt class="doc"><a name="kerning" id="kerning"></a>kerning <em class="option">pixels</em></dt>
872
873   <dd></dd>
874
875   <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>
876
877   <dd></dd>
878
879   <dt class="doc"><a name="matte" id="matte"></a>matte <em class="option">x,y method</em></dt>
880
881 <dd>Choose from these methods:
882
883 <pre class="text">
884   point
885   replace
886   floodfill
887   filltoborder
888   reset
889 </pre>
890
891 </dd>
892
893   <dt class="doc"><a name="offset" id="offset"></a>offset <em class="option">offset</em></dt>
894
895   <dd></dd>
896
897   <dt class="doc"><a name="opacity" id="opacity"></a>opacity <em class="option">opacity</em></dt>
898
899 <dd>Use percent (e.g. 50%).</dd>
900
901   <dt class="doc"><a name="path" id="path"></a>path <em class="option">path</em></dt>
902
903   <dd></dd>
904
905   <dt class="doc"><a name="point" id="point"></a>point <em class="option">x,y</em></dt>
906
907   <dd></dd>
908
909   <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>
910
911   <dd></dd>
912
913   <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>
914
915   <dd></dd>
916
917   <dt class="doc"><a name="pop-clip-path" id="pop-clip-path"></a>pop clip-path</dt>
918
919   <dd></dd>
920
921   <dt class="doc"><a name="pop-defs" id="pop-defs"></a>pop defs</dt>
922
923   <dd></dd>
924
925   <dt class="doc"><a name="pop-gradient" id="pop-gradient"></a>pop gradient</dt>
926
927   <dd></dd>
928
929   <dt class="doc"><a name="pop-graphic-context" id="pop-graphic-context"></a>pop graphic-context</dt>
930
931   <dd></dd>
932
933   <dt class="doc"><a name="pop-pattern" id="pop-pattern"></a>pop pattern</dt>
934
935   <dd></dd>
936
937   <dt class="doc"><a name="push" id="push"></a>push clip-path <em class="option">name</em></dt>
938
939   <dd></dd>
940
941   <dt class="doc"><a name="push-defs" id="push-defs"></a>push defs</dt>
942
943   <dd></dd>
944
945   <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>
946
947   <dd></dd>
948
949   <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>
950
951   <dd></dd>
952
953   <dt class="doc"><a name="push-graphic-context" id="push-graphic-context"></a>push graphic-context</dt>
954
955   <dd></dd>
956
957   <dt class="doc"><a name="push-pattern" id="push-pattern"></a>push pattern <em class="option">id radial x,y width,height</em></dt>
958
959   <dd></dd>
960
961   <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>
962
963   <dd></dd>
964
965   <dt class="doc"><a name="rotate" id="rotate"></a>rotate <em class="option">angle</em></dt>
966
967   <dd></dd>
968
969   <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>
970
971   <dd></dd>
972
973   <dt class="doc"><a name="scale" id="scale"></a>scale <em class="option">x,y</em></dt>
974
975   <dd></dd>
976
977   <dt class="doc"><a name="skewX" id="skewX"></a>skewX <em class="option">angle</em></dt>
978
979   <dd></dd>
980
981   <dt class="doc"><a name="skewY" id="skewY"></a>skewX <em class="option">angle</em></dt>
982
983   <dd></dd>
984
985   <dt class="doc"><a name="stop-color" id="stop-color"></a>stop-color <em class="option">color offset</em></dt>
986
987   <dd></dd>
988
989   <dt class="doc"><a name="stroke" id="stroke"></a>stroke <em class="option">color</em></dt>
990
991   <dd></dd>
992
993   <dt class="doc"><a name="stroke-antialias" id="stroke-antialias"></a>stroke-antialias <em class="option">0 &bull; 1</em></dt>
994
995   <dd></dd>
996
997   <dt class="doc"><a name="stroke-dasharray" id="stroke-dasharray"></a>stroke-dasharray <em class="option">none &bull; numeric-list</em></dt>
998
999   <dd></dd>
1000
1001   <dt class="doc"><a name="stroke-dashoffset" id="stroke-dashoffset"></a>stroke-dashoffset <em class="option">offset</em></dt>
1002
1003   <dd></dd>
1004
1005   <dt class="doc"><a name="stroke-linecap" id="stroke-linecap"></a>stroke-linecap <em class="option">type</em></dt>
1006
1007
1008   <dd>Choose from these cap types:
1009
1010 <pre class="text">
1011   butt
1012   round
1013   square
1014 </pre>
1015
1016   </dd>
1017
1018   <dt class="doc"><a name="stroke-linejoin" id="stroke-linejoin"></a>stroke-linejoin <em class="option">type</em></dt>
1019
1020   <dd>Choose from these join types:
1021
1022 <pre class="text">
1023   bevel
1024   miter
1025   round
1026 </pre>
1027
1028   </dd>
1029
1030   <dt class="doc"><a name="stroke-miterlimit" id="stroke-miterlimit"></a>stroke-miterlimit <em class="option">limit</em></dt>
1031
1032   <dd></dd>
1033
1034   <dt class="doc"><a name="stroke-opacity" id="stroke-opacity"></a>stroke-opacity <em class="option">opacity</em></dt>
1035
1036   <dd>The opacity ranges from 0.0 (fully transparent) to 1.0 (fully opaque) or as a percentage (e.g. 50%).
1037   </dd>
1038
1039   <dt class="doc"><a name="stroke-width" id="stroke-width"></a>stroke-width <em class="option">width</em></dt>
1040
1041   <dd></dd>
1042
1043   <dt class="doc"><a name="text" id="text"></a>text <em class="option">"text"</em></dt>
1044
1045   <dd></dd>
1046
1047   <dt class="doc"><a name="text-antialias" id="text-antialias"></a>text-antialias <em class="option">0 &bull; 1</em></dt>
1048
1049   <dd></dd>
1050
1051   <dt class="doc"><a name="text-undercolor" id="text-undercolor"></a>text-undercolor <em class="option">color</em></dt>
1052
1053   <dd></dd>
1054
1055   <dt class="doc"><a name="translate" id="translate"></a>translate <em class="option">x,y</em></dt>
1056
1057   <dd></dd>
1058
1059   <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>
1060
1061   <dd></dd>
1062
1063 </dl>
1064
1065 </div>
1066
1067
1068 \r
1069 </div>\r
1070 \r
1071 <div id="linkbar">\r
1072     <span id="linkbar-west">&nbsp;</span>\r
1073     <span id="linkbar-center">\r
1074       <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;\r
1075       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>\r
1076     </span>\r
1077     <span id="linkbar-east">&nbsp;</span>\r
1078   </div>\r
1079   <div class="footer">\r
1080     <span id="footer-west">&copy; 1999-2010 ImageMagick Studio LLC</span>\r
1081     <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>\r
1082   </div>\r
1083   <div style="clear: both; margin: 0; width: 100%; "></div>\r
1084   <script type="text/javascript">\r
1085     var _gaq = _gaq || [];\r
1086     _gaq.push(['_setAccount', 'UA-17690367-1']);\r
1087     _gaq.push(['_trackPageview']);\r
1088 \r
1089     (function() {\r
1090       var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
1091       ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
1092       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
1093     })();\r
1094   </script>\r
1095 </body>\r
1096 </html>\r