mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
141 lines
4.8 KiB
HTML
141 lines
4.8 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.ImageTransform Module</title>
|
|
<link rel='stylesheet' href='effbot.css' type='text/css' />
|
|
</head>
|
|
<body>
|
|
<h1>The PIL.ImageTransform Module</h1>
|
|
<dl>
|
|
<dt><b>AffineTransform</b> (class) [<a href='#PIL.ImageTransform.AffineTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define an affine image transform.</p>
|
|
<dl>
|
|
<dt><i>matrix</i></dt>
|
|
<dd>
|
|
A 6-tuple (<i>a, b, c, d, e, f</i>) containing
|
|
the first two rows from an affine transform matrix.
|
|
</dd>
|
|
</dl><br />
|
|
<p>For more information about this class, see <a href='#PIL.ImageTransform.AffineTransform-class'><i>The AffineTransform Class</i></a>.</p>
|
|
</dd>
|
|
<dt><b>ExtentTransform</b> (class) [<a href='#PIL.ImageTransform.ExtentTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define a transform to extract a subregion from an image.</p>
|
|
<dl>
|
|
<dt><i>bbox</i></dt>
|
|
<dd>
|
|
A 4-tuple (<i>x0, y0, x1, y1</i>) which specifies
|
|
two points in the input image's coordinate system.
|
|
</dd>
|
|
</dl><br />
|
|
<p>For more information about this class, see <a href='#PIL.ImageTransform.ExtentTransform-class'><i>The ExtentTransform Class</i></a>.</p>
|
|
</dd>
|
|
<dt><b>MeshTransform</b> (class) [<a href='#PIL.ImageTransform.MeshTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define an mesh image transform.</p>
|
|
<dl>
|
|
<dt><i>data</i></dt>
|
|
<dd>
|
|
</dd>
|
|
</dl><br />
|
|
<p>For more information about this class, see <a href='#PIL.ImageTransform.MeshTransform-class'><i>The MeshTransform Class</i></a>.</p>
|
|
</dd>
|
|
<dt><b>QuadTransform</b> (class) [<a href='#PIL.ImageTransform.QuadTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define an quad image transform.</p>
|
|
<dl>
|
|
<dt><i>xy</i></dt>
|
|
<dd>
|
|
An 8-tuple (<i>x0, y0, x1, y1, x2, y2, y3, y3</i>) which
|
|
contain the upper left, lower left, lower right, and upper right
|
|
corner of the source quadrilateral.
|
|
</dd>
|
|
</dl><br />
|
|
<p>For more information about this class, see <a href='#PIL.ImageTransform.QuadTransform-class'><i>The QuadTransform Class</i></a>.</p>
|
|
</dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageTransform.AffineTransform-class' name='PIL.ImageTransform.AffineTransform-class'>The AffineTransform Class</a></h2>
|
|
<dl>
|
|
<dt><b>AffineTransform</b> (class) [<a href='#PIL.ImageTransform.AffineTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define an affine image transform.
|
|
</p><p>
|
|
This function takes a 6-tuple (<i>a, b, c, d, e, f</i>) which
|
|
contain the first two rows from an affine transform matrix. For
|
|
each pixel (<i>x, y</i>) in the output image, the new value is
|
|
taken from a position (a <i>x</i> + b <i>y</i> + c,
|
|
d <i>x</i> + e <i>y</i> + f) in the input image, rounded to
|
|
nearest pixel.
|
|
</p><p>
|
|
This function can be used to scale, translate, rotate, and shear the
|
|
original image.
|
|
|
|
</p><dl>
|
|
<dt><i>matrix</i></dt>
|
|
<dd>
|
|
A 6-tuple (<i>a, b, c, d, e, f</i>) containing
|
|
the first two rows from an affine transform matrix.
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageTransform.ExtentTransform-class' name='PIL.ImageTransform.ExtentTransform-class'>The ExtentTransform Class</a></h2>
|
|
<dl>
|
|
<dt><b>ExtentTransform</b> (class) [<a href='#PIL.ImageTransform.ExtentTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define a transform to extract a subregion from an image.
|
|
</p><p>
|
|
Maps a rectangle (defined by two corners) from the image to a
|
|
rectangle of the given size. The resulting image will contain
|
|
data sampled from between the corners, such that (<i>x0, y0</i>)
|
|
in the input image will end up at (0,0) in the output image,
|
|
and (<i>x1, y1</i>) at <i>size</i>.
|
|
</p><p>
|
|
This method can be used to crop, stretch, shrink, or mirror an
|
|
arbitrary rectangle in the current image. It is slightly slower than
|
|
<b>crop</b>, but about as fast as a corresponding <b>resize</b>
|
|
operation.
|
|
|
|
</p><dl>
|
|
<dt><i>bbox</i></dt>
|
|
<dd>
|
|
A 4-tuple (<i>x0, y0, x1, y1</i>) which specifies
|
|
two points in the input image's coordinate system.
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageTransform.MeshTransform-class' name='PIL.ImageTransform.MeshTransform-class'>The MeshTransform Class</a></h2>
|
|
<dl>
|
|
<dt><b>MeshTransform</b> (class) [<a href='#PIL.ImageTransform.MeshTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<dl>
|
|
<dt><i>data</i></dt>
|
|
<dd>
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
<h2><a id='PIL.ImageTransform.QuadTransform-class' name='PIL.ImageTransform.QuadTransform-class'>The QuadTransform Class</a></h2>
|
|
<dl>
|
|
<dt><b>QuadTransform</b> (class) [<a href='#PIL.ImageTransform.QuadTransform-class'>#</a>]</dt>
|
|
<dd>
|
|
<p>Define an quad image transform.
|
|
</p><p>
|
|
Maps a quadrilateral (a region defined by four corners) from the
|
|
image to a rectangle of the given size.
|
|
|
|
</p><dl>
|
|
<dt><i>xy</i></dt>
|
|
<dd>
|
|
An 8-tuple (<i>x0, y0, x1, y1, x2, y2, y3, y3</i>) which
|
|
contain the upper left, lower left, lower right, and upper right
|
|
corner of the source quadrilateral.
|
|
</dd>
|
|
</dl><br />
|
|
</dd>
|
|
</dl>
|
|
</body></html>
|