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

« back to all changes in this revision

Viewing changes to Doc/PIL.ImageOps.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
 
<html><head><title>Module PIL.ImageOps</title><link href="pythondoc.css" rel="stylesheet" title="style" /></head><body><h1>Module PIL.ImageOps</h1><h4>Module Summary:</h4><pre><a href="#70">def autocontrast</a>(image, cutoff=0, ignore=None)</pre><blockquote>Maximize (normalize) image contrast.</blockquote><pre><a href="#145">def colorize</a>(image, black, white)</pre><blockquote>Colorize grayscale image.</blockquote><pre><a href="#167">def crop</a>(image, border=0)</pre><blockquote>Remove border from image.</blockquote><pre><a href="#182">def deform</a>(image, deformer, resample=2)</pre><blockquote>Deform the image.</blockquote><pre><a href="#196">def equalize</a>(image)</pre><blockquote>Equalize the image histogram.</blockquote><pre><a href="#219">def expand</a>(image, border=0, fill=0)</pre><pre><a href="#251">def fit</a>(image, size, method=0, bleed=0.0, centering=(0.5, 0.5))</pre><blockquote>Returns a sized and cropped version of the image, cropped to the
2
 
requested aspect ratio and size.</blockquote><pre><a href="#326">def flip</a>(image)</pre><blockquote>Flip the image vertically (top to bottom).</blockquote><pre><a href="#336">def grayscale</a>(image)</pre><blockquote>Convert the image to grayscale.</blockquote><pre><a href="#346">def invert</a>(image)</pre><blockquote>Invert (negate) the image.</blockquote><pre><a href="#359">def mirror</a>(image)</pre><blockquote>Flip image horizontally (left to right).</blockquote><pre><a href="#370">def posterize</a>(image, bits)</pre><blockquote>Reduce the number of bits for each colour channel.</blockquote><pre><a href="#385">def solarize</a>(image, threshold=128)</pre><blockquote>Invert all pixel values above a threshold.</blockquote><h2>Functions</h2><div class="function" id="70"><h3>autocontrast</h3><pre>autocontrast(image, cutoff=0, ignore=None)</pre><p>Maximize (normalize) image contrast.  This function calculates a
3
 
histogram of the input image, removes <i>cutoff</i> percent of the
4
 
lightest and darkest pixels from the histogram, and remaps the image
5
 
so that the darkest pixel becomes black (0), and the lightest
6
 
becomes white (255).
7
 
 
8
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to process.
9
 
</p><p><code>cutoff</code> -- How many percent to cut off from the histogram.
10
 
</p><p><code>ignore</code> -- The background pixel value (use None for no background).
11
 
</p><h4>Returns:</h4><p>An image.
12
 
</p></div><div class="function" id="145"><h3>colorize</h3><pre>colorize(image, black, white)</pre><p>Colorize grayscale image.  The <i>black</i> and <i>white</i>
13
 
arguments should be RGB tuples; this function calculates a colour
14
 
wedge mapping all black pixels in the source image to the first
15
 
colour, and all white pixels to the second colour.
16
 
 
17
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to colourize.
18
 
</p><p><code>black</code> -- The colour to use for black input pixels.
19
 
</p><p><code>white</code> -- The colour to use for white input pixels.
20
 
</p><h4>Returns:</h4><p>An image.
21
 
</p></div><div class="function" id="167"><h3>crop</h3><pre>crop(image, border=0)</pre><p>Remove border from image.  The same amount of pixels are removed
22
 
from all four sides.  This function works on all image modes.
23
 
 
24
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to crop.
25
 
</p><p><code>border</code> -- The number of pixels to remove.
26
 
</p><h4>Returns:</h4><p>An image.
27
 
</p></div><div class="function" id="182"><h3>deform</h3><pre>deform(image, deformer, resample=2)</pre><p>Deform the image.
28
 
 
29
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to deform.
30
 
</p><p><code>deformer</code> -- A deformer object.
31
 
</p><p><code>resample</code> -- What resampling filter to use.
32
 
</p><h4>Returns:</h4><p>An image.
33
 
</p></div><div class="function" id="196"><h3>equalize</h3><pre>equalize(image)</pre><p>Equalize the image histogram.  This function applies a non-linear
34
 
mapping to the input image, in order to create a uniform
35
 
distribution of grayscale values in the output image.
36
 
 
37
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to equalize.
38
 
</p><h4>Returns:</h4><p>An image.
39
 
</p></div><div class="function" id="219"><h3>expand</h3><pre>expand(image, border=0, fill=0)</pre><p>Add border to the image
40
 
 
41
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to expand.
42
 
</p><p><code>border</code> -- Border width, in pixels.
43
 
</p><p><code>fill</code> -- Pixel fill value (a colour value).  Default is 0 (black).
44
 
</p><h4>Returns:</h4><p>An image.
45
 
</p></div><div class="function" id="251"><h3>fit</h3><pre>fit(image, size, method=0, bleed=0.0, centering=(0.5, 0.5))</pre><p>Returns a sized and cropped version of the image, cropped to the
46
 
requested aspect ratio and size.
47
 
</p><p>
48
 
The <b>fit</b> function was contributed by Kevin Cazabon.
49
 
 
50
 
</p><h4>Parameters:</h4><p><code>size</code> -- The requested output size in pixels, given as a
51
 
    (width, height) tuple.
52
 
</p><p><code>method</code> -- What resampling method to use.  Default is Image.NEAREST.
53
 
</p><p><code>bleed</code> -- Remove a border around the outside of the image (from all
54
 
    four edges.  The value is a decimal percentage (use 0.01 for one
55
 
    percent).  The default value is 0 (no border).
56
 
</p><p><code>centering</code> -- Control the cropping position.  Use (0.5, 0.5) for
57
 
    center cropping (e.g. if cropping the width, take 50% off of the
58
 
    left side, and therefore 50% off the right side).  (0.0, 0.0)
59
 
    will crop from the top left corner (i.e. if cropping the width,
60
 
    take all of the crop off of the right side, and if cropping the
61
 
    height, take all of it off the bottom).  (1.0, 0.0) will crop
62
 
    from the bottom left corner, etc. (i.e. if cropping the width,
63
 
    take all of the crop off the left side, and if cropping the height
64
 
    take none from the top, and therefore all off the bottom).
65
 
</p><h4>Returns:</h4><p>An image.
66
 
</p></div><div class="function" id="326"><h3>flip</h3><pre>flip(image)</pre><p>Flip the image vertically (top to bottom).
67
 
 
68
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to flip.
69
 
</p><h4>Returns:</h4><p>An image.
70
 
</p></div><div class="function" id="336"><h3>grayscale</h3><pre>grayscale(image)</pre><p>Convert the image to grayscale.
71
 
 
72
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to convert.
73
 
</p><h4>Returns:</h4><p>An image.
74
 
</p></div><div class="function" id="346"><h3>invert</h3><pre>invert(image)</pre><p>Invert (negate) the image.
75
 
 
76
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to invert.
77
 
</p><h4>Returns:</h4><p>An image.
78
 
</p></div><div class="function" id="359"><h3>mirror</h3><pre>mirror(image)</pre><p>Flip image horizontally (left to right).
79
 
 
80
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to mirror.
81
 
</p><h4>Returns:</h4><p>An image.
82
 
</p></div><div class="function" id="370"><h3>posterize</h3><pre>posterize(image, bits)</pre><p>Reduce the number of bits for each colour channel.
83
 
 
84
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to posterize.
85
 
</p><p><code>bits</code> -- The number of bits to keep for each channel (1-8).
86
 
</p><h4>Returns:</h4><p>An image.
87
 
</p></div><div class="function" id="385"><h3>solarize</h3><pre>solarize(image, threshold=128)</pre><p>Invert all pixel values above a threshold.
88
 
 
89
 
</p><h4>Parameters:</h4><p><code>image</code> -- The image to posterize.
90
 
</p><p><code>threshold</code> -- All pixels above this greyscale level are inverted.
91
 
</p><h4>Returns:</h4><p>An image.
92
 
</p></div></body></html>
 
 
b'\\ No newline at end of file'