reference/imagick/imagick/compositeimage.xml
0ffb9c9fc8f4bf1589a1a573644e1c23b6b451d1
...
...
@@ -9,15 +9,15 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>bool</type><methodname>Imagick::compositeImage</methodname>
12
+
<modifier>public</modifier> <type>bool</type><methodname>Imagick::compositeImage</methodname>
13
13
<methodparam><type>Imagick</type><parameter>composite_object</parameter></methodparam>
14
14
<methodparam><type>int</type><parameter>composite</parameter></methodparam>
15
15
<methodparam><type>int</type><parameter>x</parameter></methodparam>
16
16
<methodparam><type>int</type><parameter>y</parameter></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>channel</parameter><initializer>Imagick::CHANNEL_ALL</initializer></methodparam>
17
+
<methodparam choice="opt"><type>int</type><parameter>channel</parameter><initializer>Imagick::CHANNEL_DEFAULT</initializer></methodparam>
18
18
</methodsynopsis>
19
19
<para>
20
-
Composite one image onto another at the specified offset.
20
+
Composite one image onto another at the specified offset. Any extra arguments needed for the compose algorithm should passed to setImageArtifact with 'compose:args' as the first parameter and the data as the second parameter.
21
21
</para>
22
22
</refsect1>
23
23

...
...
@@ -81,6 +81,45 @@
81
81
</para>
82
82
</refsect1>
83
83

84
+
<refsect1 role="examples">
85
+
&reftitle.examples;
86
+
<para>
87
+
<example>
88
+
<title>Using <function>Imagick::compositeImage</function>:</title>
89
+
<para>
90
+
Composite two images with the 'mathematics' compose method
91
+
</para>
92
+
<programlisting role="php">
93
+
<![CDATA[
94
+
<?php
95
+

96
+
// Equivalent to running the command
97
+
// convert src1.png src2.png -compose mathematics -define compose:args="1,0,-0.5,0.5" -composite output.png
98
+

99
+
$src1 = new \Imagick("./src1.png");
100
+
$src2 = new \Imagick("./src2.png");
101
+

102
+
$src1->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
103
+
$src1->setImageArtifact('compose:args', "1,0,-0.5,0.5");
104
+
$src1->compositeImage($src2, Imagick::COMPOSITE_MATHEMATICS, 0, 0);
105
+
$src1->writeImage("./output.png");
106
+

107
+
?>
108
+
]]>
109
+
</programlisting>
110
+
</example>
111
+
</para>
112
+
</refsect1>
113
+
114
+
<refsect1 role="seealso">
115
+
&reftitle.seealso;
116
+
<para>
117
+
<simplelist>
118
+
<member><function>Imagick::setImageArtifact</function></member>
119
+
</simplelist>
120
+
</para>
121
+
</refsect1>
122
+
84
123
</refentry>
85
124

86
125
<!-- Keep this comment at the end of the file
87
126