mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
222 lines
5.1 KiB
HTML
222 lines
5.1 KiB
HTML
<!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>
|