~ubuntu-branches/debian/squeeze/python-imaging/squeeze

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-08-28 23:14:10 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20060828231410-lca9enmne3ecmkup
Tags: 1.1.5-11
* python-imaging-sane: Depend on python-numarray. Closes: #382190.
* Add dependencies on ${shlibs:Depends}, lost in -6. Closes: #378596.

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
First image.</dd>
 
36
<dt><i>image1</i></dt>
 
37
<dd>
 
38
Second image.</dd>
 
39
<dt>Returns:</dt>
 
40
<dd>
 
41
An image object.</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
First image.</dd>
 
55
<dt><i>image1</i></dt>
 
56
<dd>
 
57
Second image.</dd>
 
58
<dt>Returns:</dt>
 
59
<dd>
 
60
An image object.</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
<p>Return an image with the same size as the given image, but filled
 
78
with the given pixel value.</p>
 
79
<dl>
 
80
<dt><i>image</i></dt>
 
81
<dd>
 
82
Reference image.</dd>
 
83
<dt><i>value</i></dt>
 
84
<dd>
 
85
Pixel value.</dd>
 
86
<dt>Returns:</dt>
 
87
<dd>
 
88
An image object.</dd>
 
89
</dl><br />
 
90
</dd>
 
91
<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>
 
92
<dd>
 
93
<p>Compare images, and return darker pixel value
 
94
(min(image1, image2)).
 
95
</p><p>
 
96
Compares the two images, pixel by pixel, and returns a new image
 
97
containing the darker values.
 
98
 
 
99
</p><dl>
 
100
<dt><i>image1</i></dt>
 
101
<dd>
 
102
First image.</dd>
 
103
<dt><i>image1</i></dt>
 
104
<dd>
 
105
Second image.</dd>
 
106
<dt>Returns:</dt>
 
107
<dd>
 
108
An image object.</dd>
 
109
</dl><br />
 
110
</dd>
 
111
<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>
 
112
<dd>
 
113
<p>Calculate absolute difference
 
114
(abs(image1 - image2)).
 
115
</p><p>
 
116
Returns the absolute value of the difference between the two images.
 
117
 
 
118
</p><dl>
 
119
<dt><i>image1</i></dt>
 
120
<dd>
 
121
First image.</dd>
 
122
<dt><i>image1</i></dt>
 
123
<dd>
 
124
Second image.</dd>
 
125
<dt>Returns:</dt>
 
126
<dd>
 
127
An image object.</dd>
 
128
</dl><br />
 
129
</dd>
 
130
<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>
 
131
<dd>
 
132
<p>Copy image.</p>
 
133
<dl>
 
134
<dt><i>image</i></dt>
 
135
<dd>
 
136
Source image.</dd>
 
137
<dt>Returns:</dt>
 
138
<dd>
 
139
A copy of the source image.</dd>
 
140
</dl><br />
 
141
</dd>
 
142
<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>
 
143
<dd>
 
144
<p>Inverts an image
 
145
(MAX - image).</p>
 
146
<dl>
 
147
<dt><i>image</i></dt>
 
148
<dd>
 
149
Source image.</dd>
 
150
<dt>Returns:</dt>
 
151
<dd>
 
152
An image object.</dd>
 
153
</dl><br />
 
154
</dd>
 
155
<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>
 
156
<dd>
 
157
<p>Compare images, and return lighter pixel value
 
158
(max(image1, image2)).
 
159
</p><p>
 
160
Compares the two images, pixel by pixel, and returns a new image
 
161
containing the lighter values.
 
162
 
 
163
</p><dl>
 
164
<dt><i>image1</i></dt>
 
165
<dd>
 
166
First image.</dd>
 
167
<dt><i>image1</i></dt>
 
168
<dd>
 
169
Second image.</dd>
 
170
<dt>Returns:</dt>
 
171
<dd>
 
172
An image object.</dd>
 
173
</dl><br />
 
174
</dd>
 
175
<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>
 
176
<dd>
 
177
<p>Logical AND
 
178
(image1 and image2).</p>
 
179
</dd>
 
180
<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>
 
181
<dd>
 
182
<p>Logical OR
 
183
(image1 or image2).</p>
 
184
</dd>
 
185
<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>
 
186
<dd>
 
187
<p>Logical XOR
 
188
(image1 xor image2).</p>
 
189
</dd>
 
190
<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>
 
191
<dd>
 
192
<p>Superimpose positive images
 
193
(image1 * image2 / MAX).
 
194
</p><p>
 
195
Superimposes two images on top of each other. If you multiply an
 
196
image with a solid black image, the result is black. If you multiply
 
197
with a solid white image, the image is unaffected.
 
198
 
 
199
</p><dl>
 
200
<dt><i>image1</i></dt>
 
201
<dd>
 
202
First image.</dd>
 
203
<dt><i>image1</i></dt>
 
204
<dd>
 
205
Second image.</dd>
 
206
<dt>Returns:</dt>
 
207
<dd>
 
208
An image object.</dd>
 
209
</dl><br />
 
210
</dd>
 
211
<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>
 
212
<dd>
 
213
<p>Offset image data.
 
214
</p><p>
 
215
Returns a copy of the image where data has been offset by the given
 
216
distances.  Data wraps around the edges.  If yoffset is omitted, it
 
217
is assumed to be equal to xoffset.
 
218
 
 
219
</p><dl>
 
220
<dt><i>image</i></dt>
 
221
<dd>
 
222
Source image.</dd>
 
223
<dt><i>xoffset</i></dt>
 
224
<dd>
 
225
The horizontal distance.</dd>
 
226
<dt><i>yoffset</i></dt>
 
227
<dd>
 
228
The vertical distance.  If omitted, both
 
229
   distances are set to the same value.</dd>
 
230
<dt>Returns:</dt>
 
231
<dd>
 
232
An Image object.</dd>
 
233
</dl><br />
 
234
</dd>
 
235
<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>
 
236
<dd>
 
237
<p>Superimpose negative images
 
238
(MAX - ((MAX - image1) * (MAX - image2) / MAX)).
 
239
</p><p>
 
240
Superimposes two inverted images on top of each other.
 
241
 
 
242
</p><dl>
 
243
<dt><i>image1</i></dt>
 
244
<dd>
 
245
First image.</dd>
 
246
<dt><i>image1</i></dt>
 
247
<dd>
 
248
Second image.</dd>
 
249
<dt>Returns:</dt>
 
250
<dd>
 
251
An image object.</dd>
 
252
</dl><br />
 
253
</dd>
 
254
<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>
 
255
<dd>
 
256
<p>Subtract images
 
257
((image1 - image2) / scale + offset).
 
258
</p><p>
 
259
Subtracts two images, dividing the result by scale and adding the
 
260
offset. If omitted, scale defaults to 1.0, and offset to 0.0.
 
261
 
 
262
</p><dl>
 
263
<dt><i>image1</i></dt>
 
264
<dd>
 
265
First image.</dd>
 
266
<dt><i>image1</i></dt>
 
267
<dd>
 
268
Second image.</dd>
 
269
<dt>Returns:</dt>
 
270
<dd>
 
271
An image object.</dd>
 
272
</dl><br />
 
273
</dd>
 
274
<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>
 
275
<dd>
 
276
<p>Subtract images without clipping
 
277
((image1 - image2) % MAX).
 
278
</p><p>
 
279
Subtracts two images, without clipping the result.
 
280
 
 
281
</p><dl>
 
282
<dt><i>image1</i></dt>
 
283
<dd>
 
284
First image.</dd>
 
285
<dt><i>image1</i></dt>
 
286
<dd>
 
287
Second image.</dd>
 
288
<dt>Returns:</dt>
 
289
<dd>
 
290
An image object.</dd>
 
291
</dl><br />
 
292
</dd>
 
293
</dl>
 
294
</body></html>