~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to docs/pythondoc-PIL.ImageChops.html

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
 
2
<html>
 
3
<head>
 
4
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
 
5
<title>The PIL.ImageChops Module</title>
 
6
<link rel='stylesheet' href='effbot.css' type='text/css' />
 
7
</head>
 
8
<body>
 
9
<h1>The PIL.ImageChops Module</h1>
 
10
<p>The <b>ImageChops</b> module contains a number of arithmetical image
 
11
operations, called <i>channel operations</i> ("chops"). These can be
 
12
used for various purposes, including special effects, image
 
13
compositions, algorithmic painting, and more.
 
14
</p><p>
 
15
At this time, channel operations are only implemented for 8-bit
 
16
images (e.g. "L" and "RGB").
 
17
</p><p>
 
18
Most channel operations take one or two image arguments and returns
 
19
a new image.  Unless otherwise noted, the result of a channel
 
20
operation is always clipped to the range 0 to MAX (which is 255 for
 
21
all modes supported by the operations in this module).
 
22
</p><h2>Module Contents</h2>
 
23
<dl>
 
24
<dt><a id='PIL.ImageChops.add-function' name='PIL.ImageChops.add-function'><b>add(image1, image2, scale=1.0, offset=0)</b></a> [<a href='#PIL.ImageChops.add-function'>#</a>]</dt>
 
25
<dd>
 
26
<p>Add images
 
27
((image1 + image2) / scale + offset).
 
28
</p><p>
 
29
Adds two images, dividing the result by scale and adding the
 
30
offset. If omitted, scale defaults to 1.0, and offset to 0.0.
 
31
 
 
32
</p><dl>
 
33
<dt><i>image1</i></dt>
 
34
<dd>
 
35
</dd>
 
36
<dt><i>image1</i></dt>
 
37
<dd>
 
38
</dd>
 
39
<dt>Returns:</dt>
 
40
<dd>
 
41
</dd>
 
42
</dl><br />
 
43
</dd>
 
44
<dt><a id='PIL.ImageChops.add_modulo-function' name='PIL.ImageChops.add_modulo-function'><b>add_modulo(image1, image2)</b></a> [<a href='#PIL.ImageChops.add_modulo-function'>#</a>]</dt>
 
45
<dd>
 
46
<p>Add images without clipping
 
47
((image1 + image2) % MAX).
 
48
</p><p>
 
49
Adds two images, without clipping the result.
 
50
 
 
51
</p><dl>
 
52
<dt><i>image1</i></dt>
 
53
<dd>
 
54
</dd>
 
55
<dt><i>image1</i></dt>
 
56
<dd>
 
57
</dd>
 
58
<dt>Returns:</dt>
 
59
<dd>
 
60
</dd>
 
61
</dl><br />
 
62
</dd>
 
63
<dt><a id='PIL.ImageChops.blend-function' name='PIL.ImageChops.blend-function'><b>blend(image1, image2, alpha)</b></a> [<a href='#PIL.ImageChops.blend-function'>#</a>]</dt>
 
64
<dd>
 
65
<p>Blend images using constant transparency weight.
 
66
</p><p>
 
67
Same as the <b>blend</b> function in the <b>Image</b> module.
 
68
</p></dd>
 
69
<dt><a id='PIL.ImageChops.composite-function' name='PIL.ImageChops.composite-function'><b>composite(image1, image2, mask)</b></a> [<a href='#PIL.ImageChops.composite-function'>#</a>]</dt>
 
70
<dd>
 
71
<p>Create composite using transparency mask.
 
72
</p><p>
 
73
Same as the <b>composite</b> function in the <b>Image</b> module.
 
74
</p></dd>
 
75
<dt><a id='PIL.ImageChops.constant-function' name='PIL.ImageChops.constant-function'><b>constant(image, value)</b></a> [<a href='#PIL.ImageChops.constant-function'>#</a>]</dt>
 
76
<dd>
 
77
<dl>
 
78
<dt><i>image</i></dt>
 
79
<dd>
 
80
</dd>
 
81
<dt><i>value</i></dt>
 
82
<dd>
 
83
</dd>
 
84
<dt>Returns:</dt>
 
85
<dd>
 
86
</dd>
 
87
</dl><br />
 
88
</dd>
 
89
<dt><a id='PIL.ImageChops.darker-function' name='PIL.ImageChops.darker-function'><b>darker(image1, image2)</b></a> [<a href='#PIL.ImageChops.darker-function'>#</a>]</dt>
 
90
<dd>
 
91
<p>Compare images, and return darker pixel value
 
92
(min(image1, image2)).
 
93
</p><p>
 
94
Compares the two images, pixel by pixel, and returns a new image
 
95
containing the darker values.
 
96
 
 
97
</p><dl>
 
98
<dt><i>image1</i></dt>
 
99
<dd>
 
100
</dd>
 
101
<dt><i>image1</i></dt>
 
102
<dd>
 
103
</dd>
 
104
<dt>Returns:</dt>
 
105
<dd>
 
106
</dd>
 
107
</dl><br />
 
108
</dd>
 
109
<dt><a id='PIL.ImageChops.difference-function' name='PIL.ImageChops.difference-function'><b>difference(image1, image2)</b></a> [<a href='#PIL.ImageChops.difference-function'>#</a>]</dt>
 
110
<dd>
 
111
<p>Calculate absolute difference
 
112
(abs(image1 - image2)).
 
113
</p><p>
 
114
Returns the absolute value of the difference between the two images.
 
115
 
 
116
</p><dl>
 
117
<dt><i>image1</i></dt>
 
118
<dd>
 
119
</dd>
 
120
<dt><i>image1</i></dt>
 
121
<dd>
 
122
</dd>
 
123
<dt>Returns:</dt>
 
124
<dd>
 
125
</dd>
 
126
</dl><br />
 
127
</dd>
 
128
<dt><a id='PIL.ImageChops.duplicate-function' name='PIL.ImageChops.duplicate-function'><b>duplicate(image)</b></a> [<a href='#PIL.ImageChops.duplicate-function'>#</a>]</dt>
 
129
<dd>
 
130
<dl>
 
131
<dt><i>image</i></dt>
 
132
<dd>
 
133
</dd>
 
134
<dt>Returns:</dt>
 
135
<dd>
 
136
</dd>
 
137
</dl><br />
 
138
</dd>
 
139
<dt><a id='PIL.ImageChops.invert-function' name='PIL.ImageChops.invert-function'><b>invert(image)</b></a> [<a href='#PIL.ImageChops.invert-function'>#</a>]</dt>
 
140
<dd>
 
141
<dl>
 
142
<dt><i>image</i></dt>
 
143
<dd>
 
144
</dd>
 
145
<dt>Returns:</dt>
 
146
<dd>
 
147
</dd>
 
148
</dl><br />
 
149
</dd>
 
150
<dt><a id='PIL.ImageChops.lighter-function' name='PIL.ImageChops.lighter-function'><b>lighter(image1, image2)</b></a> [<a href='#PIL.ImageChops.lighter-function'>#</a>]</dt>
 
151
<dd>
 
152
<p>Compare images, and return lighter pixel value
 
153
(max(image1, image2)).
 
154
</p><p>
 
155
Compares the two images, pixel by pixel, and returns a new image
 
156
containing the lighter values.
 
157
 
 
158
</p><dl>
 
159
<dt><i>image1</i></dt>
 
160
<dd>
 
161
</dd>
 
162
<dt><i>image1</i></dt>
 
163
<dd>
 
164
</dd>
 
165
<dt>Returns:</dt>
 
166
<dd>
 
167
</dd>
 
168
</dl><br />
 
169
</dd>
 
170
<dt><a id='PIL.ImageChops.logical_and-function' name='PIL.ImageChops.logical_and-function'><b>logical_and(image1, image2)</b></a> [<a href='#PIL.ImageChops.logical_and-function'>#</a>]</dt>
 
171
<dd>
 
172
</dd>
 
173
<dt><a id='PIL.ImageChops.logical_or-function' name='PIL.ImageChops.logical_or-function'><b>logical_or(image1, image2)</b></a> [<a href='#PIL.ImageChops.logical_or-function'>#</a>]</dt>
 
174
<dd>
 
175
</dd>
 
176
<dt><a id='PIL.ImageChops.logical_xor-function' name='PIL.ImageChops.logical_xor-function'><b>logical_xor(image1, image2)</b></a> [<a href='#PIL.ImageChops.logical_xor-function'>#</a>]</dt>
 
177
<dd>
 
178
</dd>
 
179
<dt><a id='PIL.ImageChops.multiply-function' name='PIL.ImageChops.multiply-function'><b>multiply(image1, image2)</b></a> [<a href='#PIL.ImageChops.multiply-function'>#</a>]</dt>
 
180
<dd>
 
181
<p>Superimpose positive images
 
182
(image1 * image2 / MAX).
 
183
</p><p>
 
184
Superimposes two images on top of each other. If you multiply an
 
185
image with a solid black image, the result is black. If you multiply
 
186
with a solid white image, the image is unaffected.
 
187
 
 
188
</p><dl>
 
189
<dt><i>image1</i></dt>
 
190
<dd>
 
191
</dd>
 
192
<dt><i>image1</i></dt>
 
193
<dd>
 
194
</dd>
 
195
<dt>Returns:</dt>
 
196
<dd>
 
197
</dd>
 
198
</dl><br />
 
199
</dd>
 
200
<dt><a id='PIL.ImageChops.offset-function' name='PIL.ImageChops.offset-function'><b>offset(image, xoffset, yoffset=None)</b></a> [<a href='#PIL.ImageChops.offset-function'>#</a>]</dt>
 
201
<dd>
 
202
<p>Offset image data.
 
203
</p><p>
 
204
Returns a copy of the image where data has been offset by the given
 
205
distances.  Data wraps around the edges.  If yoffset is omitted, it
 
206
is assumed to be equal to xoffset.
 
207
 
 
208
</p><dl>
 
209
<dt><i>image</i></dt>
 
210
<dd>
 
211
</dd>
 
212
<dt><i>xoffset</i></dt>
 
213
<dd>
 
214
</dd>
 
215
<dt><i>yoffset</i></dt>
 
216
<dd>
 
217
</dd>
 
218
<dt>Returns:</dt>
 
219
<dd>
 
220
</dd>
 
221
</dl><br />
 
222
</dd>
 
223
<dt><a id='PIL.ImageChops.screen-function' name='PIL.ImageChops.screen-function'><b>screen(image1, image2)</b></a> [<a href='#PIL.ImageChops.screen-function'>#</a>]</dt>
 
224
<dd>
 
225
<p>Superimpose negative images
 
226
(MAX - ((MAX - image1) * (MAX - image2) / MAX)).
 
227
</p><p>
 
228
Superimposes two inverted images on top of each other.
 
229
 
 
230
</p><dl>
 
231
<dt><i>image1</i></dt>
 
232
<dd>
 
233
</dd>
 
234
<dt><i>image1</i></dt>
 
235
<dd>
 
236
</dd>
 
237
<dt>Returns:</dt>
 
238
<dd>
 
239
</dd>
 
240
</dl><br />
 
241
</dd>
 
242
<dt><a id='PIL.ImageChops.subtract-function' name='PIL.ImageChops.subtract-function'><b>subtract(image1, image2, scale=1.0, offset=0)</b></a> [<a href='#PIL.ImageChops.subtract-function'>#</a>]</dt>
 
243
<dd>
 
244
<p>Subtract images
 
245
((image1 - image2) / scale + offset).
 
246
</p><p>
 
247
Subtracts two images, dividing the result by scale and adding the
 
248
offset. If omitted, scale defaults to 1.0, and offset to 0.0.
 
249
 
 
250
</p><dl>
 
251
<dt><i>image1</i></dt>
 
252
<dd>
 
253
</dd>
 
254
<dt><i>image1</i></dt>
 
255
<dd>
 
256
</dd>
 
257
<dt>Returns:</dt>
 
258
<dd>
 
259
</dd>
 
260
</dl><br />
 
261
</dd>
 
262
<dt><a id='PIL.ImageChops.subtract_modulo-function' name='PIL.ImageChops.subtract_modulo-function'><b>subtract_modulo(image1, image2)</b></a> [<a href='#PIL.ImageChops.subtract_modulo-function'>#</a>]</dt>
 
263
<dd>
 
264
<p>Subtract images without clipping
 
265
((image1 - image2) % MAX).
 
266
</p><p>
 
267
Subtracts two images, without clipping the result.
 
268
 
 
269
</p><dl>
 
270
<dt><i>image1</i></dt>
 
271
<dd>
 
272
</dd>
 
273
<dt><i>image1</i></dt>
 
274
<dd>
 
275
</dd>
 
276
<dt>Returns:</dt>
 
277
<dd>
 
278
</dd>
 
279
</dl><br />
 
280
</dd>
 
281
</dl>
 
282
</body></html>