Built-in Module imageop

imageop The imageop module contains some useful operations on images. It operates on images consisting of 8 or 32 bit pixels stored in Python strings. This is the same format as used by gl.lrectwrite and the imgfile module. The module defines the following variables and functions:
\begin{excdesc}{error}
This exception is raised on all errors, such as unknown number of bits
per pixel, etc.
\end{excdesc}

\begin{funcdesc}{crop}{image\, psize\, width\, height\, x0\, y0\, x1\, y1}
Retur...
... the new image is mirrored. The same
holds for the y coordinates.
\end{funcdesc}

\begin{funcdesc}{scale}{image\, psize\, width\, height\, newwidth\, newheight}
R...
...rated images or
dithered images will not look nice after scaling.
\end{funcdesc}

\begin{funcdesc}{tovideo}{image\, psize\, width\, height}
Run a vertical low-pas...
...isplayed on a video device that uses
interlacing, hence the name.
\end{funcdesc}

\begin{funcdesc}{grey2mono}{image\, width\, height\, threshold}
Convert a 8-bit ...
...d and
is probably only useful as an argument to \code{mono2grey}.
\end{funcdesc}

\begin{funcdesc}{dither2mono}{image\, width\, height}
Convert an 8-bit greyscale...
...bit monochrome image using a
(simple-minded) dithering algorithm.
\end{funcdesc}

\begin{funcdesc}{mono2grey}{image\, width\, height\, p0\, p1}
Convert a 1-bit mo...
...o greyscale pass the
values \code{0} and \code{255} respectively.
\end{funcdesc}

\begin{funcdesc}{grey2grey4}{image\, width\, height}
Convert an 8-bit greyscale image to a 4-bit greyscale image without
dithering.
\end{funcdesc}

\begin{funcdesc}{grey2grey2}{image\, width\, height}
Convert an 8-bit greyscale image to a 2-bit greyscale image without
dithering.
\end{funcdesc}

\begin{funcdesc}{dither2grey2}{image\, width\, height}
Convert an 8-bit greyscal...
...e{dither2mono}, the dithering algorithm is
currently very simple.
\end{funcdesc}

\begin{funcdesc}{grey42grey}{image\, width\, height}
Convert a 4-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc}

\begin{funcdesc}{grey22grey}{image\, width\, height}
Convert a 2-bit greyscale image to an 8-bit greyscale image.
\end{funcdesc}