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
|
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=us-ascii' />
<title>The PIL.ImageOps Module</title>
<link rel='stylesheet' href='effbot.css' type='text/css' />
</head>
<body>
<h1>The PIL.ImageOps Module</h1>
<p>(New in 1.1.3) The <b>ImageOps</b> module contains a number of
'ready-made' image processing operations. This module is somewhat
experimental, and most operators only work on L and RGB images.
</p><h2>Module Contents</h2>
<dl>
<dt><a id='PIL.ImageOps.autocontrast-function' name='PIL.ImageOps.autocontrast-function'><b>autocontrast(image, cutoff=0, ignore=None)</b></a> [<a href='#PIL.ImageOps.autocontrast-function'>#</a>]</dt>
<dd>
<p>Maximize (normalize) image contrast. This function calculates a
histogram of the input image, removes <i>cutoff</i> percent of the
lightest and darkest pixels from the histogram, and remaps the image
so that the darkest pixel becomes black (0), and the lightest
becomes white (255).
</p><dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>cutoff</i></dt>
<dd>
</dd>
<dt><i>ignore</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.colorize-function' name='PIL.ImageOps.colorize-function'><b>colorize(image, black, white)</b></a> [<a href='#PIL.ImageOps.colorize-function'>#</a>]</dt>
<dd>
<p>Colorize grayscale image. The <i>black</i> and <i>white</i>
arguments should be RGB tuples; this function calculates a colour
wedge mapping all black pixels in the source image to the first
colour, and all white pixels to the second colour.
</p><dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>black</i></dt>
<dd>
</dd>
<dt><i>white</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.crop-function' name='PIL.ImageOps.crop-function'><b>crop(image, border=0)</b></a> [<a href='#PIL.ImageOps.crop-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>border</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.deform-function' name='PIL.ImageOps.deform-function'><b>deform(image, deformer, resample=Image.BILINEAR)</b></a> [<a href='#PIL.ImageOps.deform-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>deformer</i></dt>
<dd>
</dd>
<dt><i>resample</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.equalize-function' name='PIL.ImageOps.equalize-function'><b>equalize(image, mask=None)</b></a> [<a href='#PIL.ImageOps.equalize-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>mask</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.expand-function' name='PIL.ImageOps.expand-function'><b>expand(image, border=0, fill=0)</b></a> [<a href='#PIL.ImageOps.expand-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>border</i></dt>
<dd>
</dd>
<dt><i>fill</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.fit-function' name='PIL.ImageOps.fit-function'><b>fit(image, size, method=Image.NEAREST, bleed=0.0, centering=(0.5, 0.5))</b></a> [<a href='#PIL.ImageOps.fit-function'>#</a>]</dt>
<dd>
<p>Returns a sized and cropped version of the image, cropped to the
requested aspect ratio and size.
</p><p>
The <b>fit</b> function was contributed by Kevin Cazabon.
</p><dl>
<dt><i>size</i></dt>
<dd>
</dd>
<dt><i>method</i></dt>
<dd>
</dd>
<dt><i>bleed</i></dt>
<dd>
</dd>
<dt><i>centering</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.flip-function' name='PIL.ImageOps.flip-function'><b>flip(image)</b></a> [<a href='#PIL.ImageOps.flip-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.grayscale-function' name='PIL.ImageOps.grayscale-function'><b>grayscale(image)</b></a> [<a href='#PIL.ImageOps.grayscale-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.invert-function' name='PIL.ImageOps.invert-function'><b>invert(image)</b></a> [<a href='#PIL.ImageOps.invert-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.mirror-function' name='PIL.ImageOps.mirror-function'><b>mirror(image)</b></a> [<a href='#PIL.ImageOps.mirror-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.posterize-function' name='PIL.ImageOps.posterize-function'><b>posterize(image, bits)</b></a> [<a href='#PIL.ImageOps.posterize-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>bits</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
<dt><a id='PIL.ImageOps.solarize-function' name='PIL.ImageOps.solarize-function'><b>solarize(image, threshold=128)</b></a> [<a href='#PIL.ImageOps.solarize-function'>#</a>]</dt>
<dd>
<dl>
<dt><i>image</i></dt>
<dd>
</dd>
<dt><i>threshold</i></dt>
<dd>
</dd>
<dt>Returns:</dt>
<dd>
</dd>
</dl><br />
</dd>
</dl>
</body></html>
|