summaryrefslogtreecommitdiff
path: root/www/compose.html
blob: 0ea4da29020787c37180cffcaea391212ec6b4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699




<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"  />
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
  <title>ImageMagick - Alpha Compositing</title>
  <meta name="application-name" content="ImageMagick" />
  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap images. Resize an image, crop it, change its shades and colors, add captions, and more." />
  <meta name="application-url" content="https://imagemagick.org" />
  <meta name="generator" content="PHP" />
  <meta name="keywords" content="alpha, compositing, image converter, image resizer, image editor, photo editor, jpg converter, png converter, tiff converter, vector images, online, free, swiss army" />
  <meta name="rating" content="GENERAL" />
  <meta name="robots" content="INDEX, FOLLOW" />
  <meta name="generator" content="ImageMagick Studio LLC" />
  <meta name="author" content="ImageMagick Studio LLC" />
  <meta name="revisit-after" content="2 DAYS" />
  <meta name="resource-type" content="document" />
  <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" />
  <meta name="distribution" content="Global" />
  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
  <meta property='og:url' content='../' />
  <meta property='og:title' content='ImageMagick' />
  <meta property='og:image' content='../images/logo.png' />
  <meta property='og:type' content='website' />
  <meta property='og:site_name' content='ImageMagick' />
  <meta property='og:description' content="Create, Edit, Compose, or Convert Bitmap Images" />
  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
  <link href="compose.html" rel="canonical" />
  <link href="../images/wand.png" rel="icon" />
  <link href="../images/wand.ico" rel="shortcut icon" />
  <link href="assets/magick.css" rel="stylesheet" />
</head>
<body>
  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
    <a class="navbar-brand" href="../index.html"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item ">
        <a class="nav-link" href="../index.html">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item ">
        <a class="nav-link" href="download.html">Download</a>
      </li>
      <li class="nav-item ">
        <a class="nav-link" href="command-line-tools.html">Tools</a>
      </li>
      <li class="nav-item ">
        <a class="nav-link" href="command-line-processing.html">Command-line</a>
      </li>
      <li class="nav-item ">
        <a class="nav-link" href="develop.html">Develop</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a>
      </li>
      <li class="nav-item">
          
      </li>
      <li class="nav-item">
        <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe>
      </li>
    </ul>
    </div>
    <form class="form-inline my-2 my-md-0" action="https://imagemagick.org/script/search.php">
      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
    </form>
  </nav>
  <div class="container">
   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
         style="display:block"
         data-ad-client="ca-pub-3129977114552745"
         data-ad-slot="6345125851"
         data-full-width-responsive="true"
         data-ad-format="horizontal"></ins>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

  </div>

  <main role="main" class="container">
    <div class="magick-template">
<div class="magick-header">

<p class="lead magick-description">This page descibed the Image composition methods that is used to define how
two images should be merged together in various image operations.  For the
Command Line API it is typically set using the <a
href="command-line-options.html#compose" >-compose</a> setting option. </p>


<p>The description of composition uses abstract terminology in order to allow
the description to be more precise, while avoiding constant values which are
specific to a particular build configuration. Each image pixel is represented
by red, green, and blue levels (which are equal for a gray pixel). The
build-dependent value <var>QuantumRange</var> is the maximum integral
value which may be stored, per pixel, in the red, green, or blue channels of
the image. Each image pixel may also optionally (if the image matte channel is
enabled) have an associated level of opacity, ranging from <var>opaque</var> to
<var>transparent</var>, which may be used to determine the influence of the pixel
color when compositing the pixel with another image pixel. If the image matte
channel is disabled, then all pixels in the image are treated as opaque. The
color of an opaque pixel is fully visible while the color of a transparent
pixel color is entirely absent (pixel color is ignored).</p>

<p>By definition, raster images have a rectangular shape. All image rows are of
equal length, as are all image columns. By treating the alpha channel as a
visual "mask" the rectangular image may be given a "shape" by treating the
alpha channel as a cookie-cutter for the image. This is done by setting the
pixels within the shape to be opaque, with pixels outside the shape set as
transparent. Pixels on the boundary of the shape may be between opaque and
transparent in order to provide antialiasing (visually smooth edges). The
description of the composition operators use this concept of image "shape" in
order to make the description of the operators easier to understand. While it
is convenient to describe the operators in terms of "shapes" they are by no
means limited to mask-style operations since they are based on continuous
floating-point mathematics rather than simple boolean operations.</p>

<p>The following alpha blending (Duff-Porter) compose methods are available:</p>

<table class="table table-sm table-hover">
  <tbody>
  <tr>
    <th align="left" style="width: 8%">Method</th>
    <th align="left">Description</th>
  </tr>

  <tr>
    <td>clear</td>
    <td>Both the color and the alpha of the destination are
        cleared. Neither the source nor the destination are used (except for
        destinations size and other meta-data which is always preserved.</td>
  </tr>

  <tr>
    <td>src</td>
    <td>The source is copied to the destination. The destination
        is not used as input, though it is cleared.</td>
  </tr>

  <tr>
    <td>dst</td>
    <td>The destination is left untouched. The source image is
        completely ignored.</td>
  </tr>

  <tr>
    <td>src-over</td>
    <td>The source is composited over the destination. this is
       the default alpha blending compose method, when neither the compose
       setting is set, nor is set in the image meta-data.</td>
  </tr>

  <tr>
    <td>dst-over</td>
    <td>The destination is composited over the source and the
        result replaces the destination.</td>
  </tr>

  <tr>
    <td>src-in</td>
    <td>The part of the source lying inside of the destination
        replaces the destination.</td>
  </tr>

  <tr>
    <td>dst-in</td>
    <td>The part of the destination lying inside of the source
        replaces the destination. Areas not overlaid are cleared.</td>
  </tr>

  <tr>
    <td>src-out</td>
    <td>The part of the source lying outside of the destination
        replaces the destination.</td>
  </tr>

  <tr>
    <td>dst-out</td>
    <td>The part of the destination lying outside of the source
        replaces the destination.</td>
  </tr>

  <tr>
    <td>src-atop</td>
    <td>The part of the source lying inside of the destination is
        composited onto the destination.</td>
  </tr>

  <tr>
    <td>dst-atop</td>
    <td>The part of the destination lying inside of the source is
        composited over the source and replaces the destination. Areas not
        overlaid are cleared. </td>
  </tr>

  <tr>
    <td>xor</td>
    <td>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.  Source or Destination, but not both. </td>
  </tr>

  </tbody>
</table>

<p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
For example the default compose method can be specified as just 'Over'.</p>

<p>Many of these compose methods will clear the destination image which was
not overlaid by the source image.  This is to be expected as part of that
specific composition methods defintion. You can disable this by setting the
special <a href="command-line-options.html#define"
>-define</a> 'compose:outside-overlay' to a value of 'false' will turn off
this behavior. </p>

<p>On top of the above 12 Duff-Porter Alpha Composition methods, one special
related method '<code>Copy</code>' has been provided. This is equivalent to
using the '<code>Src</code>'  with the special <a href="command-line-options.html#define"
>-define</a> option '<code>compose:outside-overlay</code>' set to
'<code>false</code>', so as to only modify the overlaid area, without clearing
the rest of the image outside the overlaid area.  </p>

<p>The following mathematical composition methods are also available. </p>

<table class="table table-sm table-hover">
  <tbody>
  <tr>
    <th align="left" style="width: 8%">Method</th>
    <th align="left">Description</th>
  </tr>

  <tr>
    <td>multiply</td>
    <td>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>
  </tr>

  <tr>
    <td>screen</td>
    <td>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>
  </tr>

  <tr>
    <td>plus</td>
    <td>The source is added to the destination and replaces the
        destination. This operator is useful for averaging or a controlled
        merger of two images, rather than a direct overlay.</td>
  </tr>

  <tr>
    <td>add</td>
    <td>As per 'plus' but transparency data is treated as matte
        values. As such any transparent areas in either image remain
        transparent. </td>
  </tr>

  <tr>
    <td>minus</td>
    <td>Subtract the colors in the source image from the
        destination image. When transparency is involved, opaque areas is
        subtracted from any destination opaque areas. </td>
  </tr>

  <tr>
    <td>subtract</td>
    <td>Subtract the colors in the source image from the
        destination image. When transparency is involved transparent areas are
        subtracted, so only the opaque areas in the source remain opaque in
        the destination image. </td>
  </tr>

  <tr>
    <td>difference</td>
    <td>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>
  </tr>

  <tr>
    <td>exclusion</td>
    <td>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>
  </tr>

  <tr>
    <td>darken</td>
    <td>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>
  </tr>

  <tr>
    <td>lighten</td>
    <td>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>
  </tr>

  <tr>
    <td>negate</td>
    <td>The "opposite" of difference mode. Note that it is not difference mode inverted, because black and white return the same result, but colors between become brighter instead of darker. </td>
  </tr>

  <tr>
    <td>reflect</td>
    <td>This mode is useful when adding shining objects or light zones to images. The formula is similar to color dodge, but the result is not that bright in most cases. The result looks a bit like soft light. </td>
  </tr>

  <tr>
    <td>freeze</td>
    <td>Another variation of reflect mode (base and blend color inverted, the result inverted again). </td>
  </tr>

  <tr>
    <td>stamp</td>
    <td>This mode somehow is similar to average mode. It is helpful when applying relief or bump textures to images. </td>
  </tr>

  <tr>
    <td>interpolate</td>
    <td>This mode somehow combines multiply and screen mode (looks very similar for very dark or bright colors). </td>
  </tr>
</table>

<p>Typically these use the default 'Over' alpha blending when transparencies
are also involved, except for 'Plus' which uses a 'plus' alpha blending.  This
means the alpha channel  of both images will only be used to ensure that any
visible input remains visible even in parts not overlaid. It also means that
any values are weighted by the alpha channel of the input and output images.
This 'Over' alpha blending is also applied to the lighting composition methods
below. </p>

<p> The math composition is applied on an individual channel basis as defined by the <a href="command-line-options.html#channel" >-channel</a>.  This includes the alpha channel. This special usage allows you to perform true mathematics of the image channels, without alpha
composition effects, becoming involved. </p>

<p>The following lighting composition methods are also available. </p>

<table class="table table-sm table-hover">
  <tbody>
  <tr>
    <th align="left" style="width: 8%">Method</th>
    <th align="left">Description</th>
  </tr>

  <tr>
    <td>linear-dodge</td>
    <td>This is equivalent to 'Plus' in that the color channels
        are simply added, however it does not 'Plus' the alpha channel, but
        uses the normal 'Over' alpha blending, which transparencies are
        involved.  Produces a sort of additive multiply-like result.  </td>
  </tr>

  <tr>
    <td>linear-burn</td>
    <td>As 'Linear-Dodge', but also subtract one from the result.
        Sort of a additive 'Screen' of the images. </td>
  </tr>

  <tr>
    <td>color-dodge</td>
    <td>Brightens the destination color to reflect the source
        color. Painting with black produces no change.</td>
  </tr>

  <tr>
    <td>color-burn</td>
    <td>Darkens the destination color to reflect the source
        color.  Painting with white produces no change.  </td>
  </tr>

  <tr>
    <td>overlay</td>
    <td>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>
  </tr>

  <tr>
    <td>hard-light</td>
    <td>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>
  </tr>


  <tr>
    <td>linear-light</td>
    <td>Like 'Hard-Light' but using linear-dodge and linear-burn
        instead.  Increases contrast slightly with an impact on the
        foreground's tonal values.</td>
  </tr>

  <tr>
    <td>soft-burn</td>
    <td>A combination of color burn and inverse color dodge mode, but a lot smoother than both of them. The base image is lightened a bit, but very dark blend colors are "burned" in. </td>
  </tr>

  <tr>
    <td>soft-dodge</td>
    <td> Combination of color dodge and inverse color burn mode, but a lot smoother than both of them. The base image is darkened a bit, but very bright blend colors are "dodged" in. </td>
  </tr>

  <tr>
    <td>soft-light</td>
    <td>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>
  </tr>

  <tr>
    <td>pegtop-light</td>
    <td>Almost equivalent to 'Soft-Light', but using a
        continuous mathematical formula rather than two conditionally
        selected formulae. </td>
  </tr>

  <tr>
    <td>vivid-light</td>
    <td>A modified 'Linear-Light' designed to preserve very stong
        primary and secondary colors in the image.  </td>
  </tr>

  <tr>
    <td>pin-light</td>
    <td>Similar to 'Hard-Light', but using sharp linear shadings,
        to simulate the effects of a strong 'pinhole' light source. </td>
  </tr>

  </tbody>
</table>

<p>Also included are these special purpose compose methods:</p>

<table class="table table-sm table-hover">
  <tbody>
  <tr>
    <th align="left" style="width: 8%">Method</th>
    <th align="left">Description</th>
  </tr>

  <tr>
    <td>copy</td>
    <td>This is equivalent to the Duff-Porter composition method
        '<code>Src,</code>' but without clearing the parts of the destination
        image that is not overlaid.  </td>
    </tr>

  <tr>
    <td>copy-*</td>
    <td>Copy the specified channel (Red, Green, Blue, Cyan,
        Magenta, Yellow, Black, or Opacity) in the source image to the
        same channel in the destination image.  If the channel specified
        does not exist in the source image, (which can only happen for methods,
        '<code>copy-opacity</code>' or '<code>copy-black</code>') then it is
        assumed that the source image is a special grayscale channel image
        of the values that is to be copied. </td>
    </tr>

  <tr>
    <td>change-mask</td>
    <td>Replace any destination pixel that is the similar to the
    source images pixel (as defined by the current <a
    href="command-line-options.html#fuzz">-fuzz</a> factor), with transparency.
    </td>
  </tr>

  <tr>
    <td>stereo</td>
    <td>create a stereo anaglyph</td>
  </tr>
  </tbody>
</table>

<p>On top of these composed methods are a few special ones that not only require
the two images that are being merged or overlaid, but have some extra numerical
arguments, which are tabled below. </p>

<p>In the "<code>composite</code>" command these composition methods are
selected using special options with the arguments needed. They are usually,
but not always, the same name as the composite 'method' they use, and replaces
the normal use of the <a href="command-line-options.html#compose" >-compose</a>
setting in the "<code>composite</code>" command.  For example... </p>

<pre class="highlight"><code>composite ... -blend 50x50 ...
</code></pre>

<p>The "<code>magick</code>" command can accept these extra arguments to its <a href="command-line-options.html#composite"
>-composite</a> operator, using the special <a href="command-line-options.html#define">-define</a>
attribute of '<code class="arg">compose:args</code>'.  This means you can now
make use of these special augmented <a href="command-line-options.html#compose"
>-compose</a> methods, those the argument and the method both need to be set
separately.  For example... </p>

<pre class="highlight"><code>magick ... -compose blend  -define compose:args=50,50 -composite ...
</code></pre>

<p>The following is a table of these special 'argumented' compose methods,
with a brief summary of what they do. For more details see the equivalent
"composite" command option name.  </p>

<table class="table table-sm table-hover">
  <tbody>
  <tr>
    <th align="left" style="width: 8%">Method</th>
    <th align="left">Description</th>
  </tr>

  <tr>
    <td>dissolve</td>
    <td>Arguments:
        <var>src_percent</var>[x<var>dst_percent</var>]
    <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#dissolve">-dissolve</a>
    <br/>Dissolve the 'source' image by the percentage given before overlaying
        'over' the 'destination' image. If <var>src_percent</var> is
        greater than 100, it starts dissolving the main image so it will
        become transparent at a value of '<code class="arg">200</code>'.  If
        both percentages are given, each image are dissolved to the
        percentages given.
    </td>
  </tr>

  <tr>
    <td>blend</td>
    <td>Arguments:
        <var>src_percent</var>[x<var>dst_percent</var>]
    <br/>Equivalent to "<code>composite</code>" <a
        href="command-line-options.html#blend">-blend</a>
    <br/>Average the images together ('plus') according to the percentages
        given and each pixels transparency.  If only a single percentage value
        is given it sets the weight of the composite or 'source' image, while
        the background image is weighted by the exact opposite amount. That is
        a <code>-blend 30</code> merges 30% of the 'source' image with 70% of
        the 'destination' image.  Thus it is equivalent to <code>-blend
        30x70</code>.
    </td>
  </tr>

  <tr>
    <td>mathematics</td>
    <td>Arguments: <var>A, B, C, D</var>
    <br/>Not available in "<code>composite</code>" at this time.
    <br/>Merge the source and destination images according to the formula
    <br/>     <code>A*Sc*Dc + B*Sc + C*Dc + D</code>
    <br/>Can be used to generate a custom composition method that would
        otherwise need to be implemented using the slow <a
        href="command-line-options.html#fx">-fx</a> DIY image operator.
    </td>
  </tr>

  <tr>
    <td>modulate</td>
    <td>Arguments:
        <var>brightness</var>[x<var>saturation</var>]
    <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#watermark">-watermark</a>
    <br/>Take a grayscale image (with alpha mask) and modify the destination
        image's brightness according to watermark image's grayscale value and
        the <var>brightness</var> percentage.  The destinations
        color saturation attribute is just direct modified by the <var>saturation</var> percentage, which defaults to 100 percent
        (no color change).

    </td>
  </tr>

  <tr>
    <td>displace</td>
    <td>Arguments:
        <var>X-scale</var>[x<var>Y-scale</var>][!][%]
    <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#displace">-displace</a>
    <br/>With this option, the 'overlay' image, and optionally the 'mask'
        image, is used as a relative displacement map, which is used to
        displace the lookup of what part of the destination image is seen at
        each point of the overlaid area.  Much like the displacement map is a
        'lens' that distorts the original 'background' image behind it.
    <br/><br/>
        The X-scale is modulated by the 'red' channel of the overlay image
        while the Y-scale is modulated by the green channel, (the mask image
        if given is rolled into green channel of the overlay image. This
        separation allows you to modulate the X and Y lookup displacement
        separately allowing you to do 2-dimensional displacements, rather
        than 1-dimensional vectored displacements (using grayscale image).
    <br/><br/>
        If the overlay image contains transparency this is used as a mask
        of the resulting image to remove 'invalid' pixels.
    <br/><br/>
        The '%' flag makes the displacement scale relative to the size of the
        overlay image (100% = half width/height of image). Using '!' switches
        percentage arguments to refer to the destination image size instead.
    <br/><br/>
    </td>
  </tr>

  <tr>
    <td>distort</td>
    <td>Arguments:
        <var>X-scale</var>[x<var>Y-scale</var>[+<var>X-center</var>+<var>Y-center</var>]][!][%]
    <br/>Not available in "<code>composite</code>" at this time.
    <br/>Exactly as per 'Displace' (above), but using absolute coordinates,
        relative to the center of the overlay (or that given).  Basically
        allows you to generate absolute distortion maps where 'black' will
        look up the left/top edge, and 'white' looks up the bottom/right
        edge of the destination image, according to the scale given.
    <br/><br/>
        The '!' flag not only switches percentage scaling, to use the
        destination image, but also the image the center offset of the lookup.
        This means the overlay can lookup a completely different region of the
        destination image.
    <br/><br/>
    </td>
  </tr>

  <tr>
    <td>blur</td>
    <td>Arguments:
        <var>Width</var>[x<var>Height</var>[+<var>Angle</var>][+<var>Angle2</var>]]
    <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#blur-composite">-blur</a>
    <br/>A Variable Blur Mapping Composition method, where each pixel in the
        overlaid region is replaced with an Elliptical Weighted Average (EWA),
        with an ellipse (typically a circle) of the given sigma size, scaled
        according to overlay (source image) grayscale mapping.
    <br/><br/>
        As per 'Displace' and 'Distort', the red channel will modulate the
        width of the ellipse, while the green channel will modulate the height
        of the ellipse. If a single Angle value is given in the arguments,
        then the ellipse will then be rotated by the angle specified.
    <br/><br/>
        Normally the blue channel of the mapping overlay image is ignored.
        However if a second ellipse angle is given, then it is assumed that
        the blue channel defines a variable angle for the ellipse ranging from
        the first angle to the second angle given.  This allows to generate
        radial blurs, or a rough approximation for rotational blur. Or any mix
        of the two.
    <br/><br/>
    </td>
  </tr>

  </tbody>
</table>

<p>To print a complete list of all the available compose operators, use <a
href="command-line-options.html#list">-list compose</a>.</p>
</div>
    </div>
  </main><!-- /.container -->
  <footer class="magick-footer">
    <div class="container">
    <p><a href="security-policy.html">Security</a> •
    <a href="news.html">News</a>
     
    <a href="compose.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
     
    <a href="links.html">Related</a> •
     <a href="sitemap.html">Sitemap</a>
    <br/>
    <a href="support.html">Sponsor</a> •
    <a href="cite.html">Cite</a> •
    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
    <a href="https://imagemagick.org/script/contact.php">Contact Us</a> 
    <br/>
    <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> •
        <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a>
    <br/>
    <small>© 1999-2020 ImageMagick Studio LLC</small></p>
    <div>
  </footer>

  <!-- Javascript assets -->
  <script>window.jQuery || document.write('<script src="assets/jquery.slim.min.js"><\/script>')</script><script src="assets/bootstrap.bundle.min.js" integrity="sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf" crossorigin="anonymous">
</body>
</html>
<!-- Magick Cache 19th November 2020 21:40 -->